460 Posted Topics

Member Avatar for Mushy-pea
Member Avatar for Mushy-pea
0
126
Member Avatar for MojoS

[CODE]#!/usr/bin/perl use strict; use warnings; open(IN, '<',"dna.dat") or die "Can't read file\n $!"; my $first_line = <IN>; my $dna = ''; while(my $line=<IN>){ chomp $line; $dna .= $line; } close IN; my $cdna = ''; for my $i (0 .. length($dna)-1){ $_ = substr($dna, $i, 1); if (!/[TAGC]/) {die "Unkown …

Member Avatar for KevinADC
0
267
Member Avatar for nanodano

tr/// only replaces characters for characters (transliteration). It is very limited but faster than s/// for simple character replacing. s/// is a full blown regexp that can use all of perls various options for pattern matching and substitution. For example if all you wanted to do was replace all A's …

Member Avatar for KevinADC
0
122
Member Avatar for MidiMagic
Member Avatar for MidiMagic
0
124
Member Avatar for Mushy-pea

It may seem strange to you, but thats because you don't understand what is happening. Whenever you send anything in the system array to a sub routine or function the list becomes "flattened". This means that where one list ends and another begins is lost, and it becomes one long …

Member Avatar for swampyankee
0
82
Member Avatar for alex_wil

maybe you need to use an array instead of a scalar for capturing the reults: my[B] @result [/B]= $t->cmd(("grep - $filename.txt~ | wc -l | awk '{print $1}'"));

Member Avatar for mandible
0
190
Member Avatar for KevinADC

The amount, size, placement, and etc, of advertisements on the pages is getting a bit obnoxious (one ad that scrolled across the screen was very obnoxious). I understand the need and the desire for advertising, but the pages are starting to look like billboards with some content thrown in instead …

Member Avatar for Dani
0
580
Member Avatar for jemather

jemather, the code you posted shouldn't even produce values for the scalars in the $sql scalar. [code]('".$title1."', '".$format1."', ".$r_date1.")"[/code] there are no $title1 or $format1 or $date1 scalars defined in the code you posted. You have $title and $format and $r_date. with the correct scalars, the line is better written …

Member Avatar for KevinADC
0
97
Member Avatar for Shon05

[QUOTE]Likewise[/QUOTE] this thread is from 2005, hopefully Shon05 has his program done by now. ;)

Member Avatar for indienick
0
484
Member Avatar for aetinti
Re: Help

why can't you use the system() function or qx// or backtiks? You can look into the Term::Readkey module which I have never used but maybe it can do what you want. You would most likely have to install it though. [url]http://search.cpan.org/~jstowe/TermReadKey-2.30/ReadKey.pm[/url]

Member Avatar for KevinADC
0
87
Member Avatar for vegaseat

hehehe... the forum moderator letting the forum members (at least the ones that couldn't figure it out) know how to defeat the file attachment restrictions. :) As you can see, it's not a very sophisticated MIME checking routine. :D

Member Avatar for KevinADC
0
55
Member Avatar for aetinti

maybe the expect module is what you need: [url]http://search.cpan.org/~rgiersig/Expect-1.20/Expect.pod[/url] but you need to use Cygwin. See the above link.

Member Avatar for aetinti
0
78
Member Avatar for concept
Member Avatar for Mushy-pea

technically, as far as I know, it is OK. In general I would say it's not good practice unless it's clear why you needed to do that or put comments in the code explaining why you are doing that. Like in the CGI module you will see a sub routine …

Member Avatar for zabina
0
216
Member Avatar for bhavna_816

that really looks like query string data, in which case the CGI module could be used to get you name value pairs into your script for further use.

Member Avatar for bhavna_816
0
81
Member Avatar for Mushy-pea

windows does not read/use the shebang line. I don't tknow what the work-around would be for this problem. It works with the http server (apache at leat) because apache for windows does some kind of unix/shebang line emulation.

Member Avatar for KevinADC
0
89
Member Avatar for bhavna_816

Do you mean you want the perl code embedded in the html code (sort of like php)? Search google for: "embedded perl"

Member Avatar for KevinADC
0
106
Member Avatar for dss
Re: Cgi

If you are running windows you want to install activestate perl [url]http://www.activestate.com/Products/ActivePerl/?mp=1[/url] this article might help but I don't know which version of apache the article is written for: [url]http://www.thesitewizard.com/archive/addcgitoapache.shtml[/url]

Member Avatar for KevinADC
0
295
Member Avatar for Mushy-pea

you might want to post that question on the perlmonks site to get answers.

Member Avatar for KevinADC
0
88
Member Avatar for jaguar founder
Member Avatar for crestaldin

this should be in the shell scripting forum: [url]http://www.daniweb.com/techtalkforums/forum113.html[/url]

Member Avatar for masijade
0
162
Member Avatar for mahe4us

[url]http://learn.perl.org/library/beginning_perl/[/url] search google for more perl tutorials and references on the internet

Member Avatar for Puckdropper
0
161
Member Avatar for kathas
Member Avatar for Bhaskar_korthi

look into the Win32 family of modules for doing things in windows with perl. probably Win32::Process

Member Avatar for KevinADC
0
58
Member Avatar for kararu

some of perls native functions are also meant for Unix, such as flock() and chmod() and some functions might return a different value depending on the operating system, like stat().

Member Avatar for MattEvans
0
94
Member Avatar for MDGM

no host supports chmoding files externally. You have to connect to the server somehow: telnet/shell, FTP, another script, to change permission of files on a server.

Member Avatar for MattEvans
0
109
Member Avatar for perlguy

if the file isn't too big this might do what you want: [code] open(FH,'file.txt'); my $data = do {local $/; <FH>}; my @data = split(/\|\|\|/,$data); print "$_\n" for @data; [/code]

Member Avatar for KevinADC
0
70
Member Avatar for Mushy-pea

[QUOTE=Mushy-pea;275340]Hello everyone. I've run into a problem with regular expressions; the extraction "variables" ($1, $2, $3 etc.) are read only and scoped to the current block. If you need to do two regex extraction operations in the same block, is there a way to reset the ($1, $2, $3 etc.) …

Member Avatar for Mushy-pea
0
138
Member Avatar for Mushy-pea

you're using the wrong brackets on your hash keys, you use {} not () [CODE]sub test_function { my($key, %table); %table = ('word1', 'Perl', 'word2', 'is', 'word3', 'great'); $key = "word3"; print $table{'word1'}; print $table{"word2"}; print $table{$key}; }[/CODE] not sure what tutorials you have read but if they are telling you …

Member Avatar for Mushy-pea
0
110
Member Avatar for kamleshpdude

look intot these operators/functions and decide which is best for your purposes: system - runs a program but doesn't return program output to the perl script. Returns exit status, if any, of run program instead. exec - runs a program but exits the perl program as soon as it's called …

Member Avatar for MattEvans
0
94

The End.