This is covered on page 2 of the first edition; I find
it hard to believe it isn't also covered right at the
beginning of the second edition.
As it says in the first, start by typing the following
at a shell prompt:
perl
If you get "not found", then you don't have perl
installed (at least n
> I'm new to perl too, but I think I can help.
Sometimes a dangerous thought... ;>
> As far as I can tell, perlscript is embeded
> right into an HTML file the same way you
> do VBScript or JavaScript
If you have a web server set up appropriately
to allow this, this is true.
There are multiple
First, some background.
There are several fundamentally different ways in
which a perl script can be run, including:
1. At a shell prompt / command line.
2. As a CGI
(there are various others.)
Each of these has its own "environment" in which
a running script runs.
These environments
> In BASIC there are commands for
> leftstring, midstring, and rightstring.
> I am looking for the perl equiv for these.
> Lets say i have a string 80 charecters long and i
> want to insert at string position 20 for 10 charecters.
substr($EightyCharsLong, 19, 10) = 'morestring';
Yes, you ca
o fiddle with the
characters that the shell treats specially, such as ', ",
and maybe $ and maybe others. For the particular
command line I suggested, I think you can just reverse
the single and double quotes:
perl -e "$_='barbar'; substr($_, 2, 2) = 'qux'
> Can anyone send me any solution
> to read the paragraph from a text file?
To read paragraphs (delimited by one or more blank
lines (really blank, no spaces or tabs)), change the
record separator from its default (newline) to the
null string ('').
$/ = '';
while (<>) {
print;
}
> A bit safer way to do this would be the following:
Jos is right in principle, but wrong in one detail.
Setting $/ to undef isn't the same as setting it to ''.
Setting it to undef makes the <> input operator
slurp the whole file.
> I don't fully understand how, when or why to use the map function -
>
> my @file = ("line 1", "line 2", "line 3", "line 4", "line 5");
> my @test = map {/5/} @file;
>
> The result when I print @test is:
> 1
>
> As I understand things, this is the m/5/ being "true"
Sorta. It's the length of
> > I don't fully understand how, when or why to use the map function -
> >
> > my @file = ("line 1", "line 2", "line 3", "line 4", "line 5");
> > my @test = map {/5/} @file;
> >
> > The result when I print @test is:
> > 1
> >
> > As I understand things, this is the m/5/ being "true"
>
> Sort
Er, self-correction self-correction:
> First:
> /5/ =~ "line 5";
>
> is done in list context.
More accurately, something like:
$_ = "line 5";
@onemap = (/5/);
push (@allmaps, @onemap);
where @onemap is really an unnamed internal list not
available to your perl code and @allmap
> What I was looking for is a way to take an
> element from @foo - change it in some way,
> and place it in @bar without changing the
> original element of @foo but do it in one
> line of code:
Well, I'd still be inclined to do something like:
@foo = @bar; for (@foo) { s/qux/waldo/ };
e
> What would be the easiest way to capture [stderr]?
One way:
$output = `$cmd 2>&1 1>$null`;
$null depends on the os; /dev/null on unix, /nul on an M$ OS.
Simplifying:
> # Renumber a series of tests from the command line
> perl -pi -e 's/(^\s+test\s+)\d+/ $1 . ++$count /e'
t/op/taint.t
This is what is called a "one-liner".
One enters the above at a shell prompt (command line).
The "perl -pi -e" combo is a common one for quick on
Oops, hadn't finished.
's/(^\s+test\s+)\d+/ $1 . ++$count /e'
Breaking this down,
s/foo/bar/
means, search $_ ($_ is the current line in many
scripts) for something, and then replace what is
matched with something else.
s/foo(bar)baz/$1/
replaces foobarbaz with bar. Parens "captu
e one you mean. For example:
${foo}bar;
$foobar;
The second one is the variable $foo followed by the
literal text 'bar'.
the /i on the end of the s/// means ignore case.
> print;
Print $_ (the current line).
> close ARGV if eof; #
Can't help much, but, fwiw:
These two are definitely completely wrong:
> $mailer->open ( 'From' => 'me <[EMAIL PROTECTED]>',
> 'To' => 'you <[EMAIL PROTECTED]>',
> 'Subject
> So it would appear that the Cookbook has got a typo.
Sorta. You might want to read in the deja thread I referred you to.
[A thread from 1999. And I didn't find a correction in the
Cookbook's errata (though that could be because the
searching process is tedious and I wasn't motivated to
keep at
> I'm having a very hard time figuring this out. Does
> anyone have any suggestions or pointers for the best
> way to go about this?
Go buy the Perl Cookbook. A truly superb book that
gives highly distilled, highly productive answers to
hundreds of standard things you will want to do like
this in
> I have been tasked to parse ~1500 log files summing a total of ~100mb
> cleanly, effectively and with little impact on the system.
I'd use http://www.analog.cx unless you really have to use perl.
It would do the whole lot in a few seconds.
> [analog] looks nice, but I am not sure it is suited for my needs
> [because the logs I'm parsing aren't web logs]
Sorry, my brain must have slipped out of gear
while I wasn't looking.
Forget analog.
The file count doesn't seem that much. I suggest
you use opendir and cousins to process files
> What is the credit protocol if... [it isn't explicitly documented]?
Ask the author.
Imo, the lexical / package distinction is not always helpful
to beginners. Here's, er, my shot at explaining this...
1. { }.
The { } pairs that appear around blocks of code represent
a 'lexical scope'. This scope decides the life time of any
name declared with my/our/local.
A file and an eval
> > [using map to transform an old array to a new array
> > leaving the old one unchanged?]
>
> Here's my best shot:
>
> map { my $foo = $_; $foo =~ s/qux/waldo/ and $foo } @bar;
Fwiw, I just thought of a more brief and elegant way:
@newarray = map { local $_ = $_; s/foo/bar/; $_ } @o
> $shash{"student1"} = join("\t", ("bob", "tyson", "room5"));
> $shash{"student2"} = join("\t", ("ron", "anderson", "room4"));
> $shash{"student3"} = join("\t", ("dave", "lee", "room2"));
> $shash{"student4"} = join("\t", ("tim", "barker", "room3"));
> $shash{"student5"} = join("\t", ("roger", "fa
> But, if you did, I think this should work:
But then it is saturday morning. Sigh. Ignore my
attempt; use Peter's.
> sub room { my $s = $shash{$_}; (split /\t/)[2] };
Wrong, twice. You wanted lastname, not room.
And the split isn't working on the right thing.
Peter's solution is clearer, n
> This should've worked. But why do I get a warning:
>
> Use of uninitialized value at ./mk2_ratingchangedb.pl line 39,
chunk 8.
Whenever you're dealing with baffling array errors
like this, always think of off-by-one.
In this case:
> 30 for ($i=1; ...) {
> 31 $dummy[$i][
> I am apparently missing something.
Being aware of buffering, I suspect.
Various parts of the 'pipe' between your print
statements and the final destination do some
sort of buffering. You can switch some of this
off in perl by specifying:
$| = 1;
> My next direction is OOP, but I have found it to be a
> little beyond my grasp each time I try. Maybe with this
> list's help I can get it.
First you have to unlearn.
Imagine you knew nothing about programming.
Now, I introduce a thing called a variable:
my Dog $spot;
(ok, the current
, thanks
Thanks for the thanks, Greg and Tim. That encourages me
to add a little more (now you got me started). The extra stuff
follows a repost of the original intro.
OOP in a few seconds
First you have to unlearn.
Imagine you knew nothing about programming.
Now, I introd
> tr{abcdefghijklmnoprstuvwxy}
> {222333444555666777888999};
or, for a smidgen extra legibility:
> tr{abc def ghi jkl mno prs tuv wxy}
> {222 333 444 555 666 777 888 999};
g that $_ is local to the function anyway.
Minor point:
Note that this localizing doesn't apply to all { }. To summarize
Jos' email to me, this should say something more like
"because the $_ is in map's {}, it's implicitly localised".
True, and anothe
> Does the C++ notion of private data have a similar structure in perl,
when
> defining packages, I find that when I try to define global variables
inside
> the package, but outside of all the subroutines, I get a million
errors.
> Thanks,
Use my to declare variables local to a package.
pack
> > > The value. If you wanted to increment the key, you would say
> > > "$hash{$key++}".
> >
> > Wait a sec, brain cramp
> > Wouldn't that:
> > 1) just access $hash{$key}
> > 2) increment $key
> > 3) add $hash{$key + 1}
> >
>
> I realize this is getting away from the original post, but
> In simple cases, step 3 will happen momentarily,
> but if you haven't used it, then it will go away, and
> the new key won't be defined.
>
> But if it's part of a larger expression that also
> dereferences out of the new element, then the
> new element will remain defined, even if that's
> not
$hash{$key++}
> > > Wait a sec, brain cramp
> > > Wouldn't that
> > > 1) just access $hash{$key}
> > > 2) increment $key
> > > 3) add $hash{$key + 1}
> >
> > I realize this is getting away from the original post, but I'm
confused by
> > #3 here. Wouldn't it just do 1 and 2? Would
> does anyone know how to pass in parameters from
> command line to a perl script?
> Is it the same as C++ where i specify an ARGV[ ]
> and ARGC value or I use the @ARGV?
Sorta.
perldoc perlvar
look for the ARGV entry
> > does anyone know how to pass in parameters from
> > command line to a perl script?
> > Is it the same as C++ where i specify an ARGV[ ]
> > and ARGC value or I use the @ARGV?
>
> Sorta.
>
> perldoc perlvar
>
> look for the ARGV entry
Some more bits about ARGV...
1. Shift will work on @A
> Please, find me some method.
http://groups.google.com/groups?ic=1&th=b1d971a887f189ca,8
I don't know of any more up to date news.
> 1. I want to read in a text file and match any line that begins with
> three capital letters followed by a space. i.e. "USD "
while (<>) {
/^[A-Z]{3} / and dostuff; # $_ contains line
}
>
> 2. I need to ignore any blank lines, lines containing all "---", lines
> containing a
I forgot to explain.
> > 1. I want to read in a text file and match any line that begins with
> > three capital letters followed by a space. i.e. "USD "
>
> while (<>) {
<> will read from the file(s) you specify on the command
line when you run your perl script, ie
perl myscript.pl
> Could someone tell me how to sort these files?
>
> As you can see they are already sorted in perl, but the problem is .7
is
> suppose to be before 10.
>
> to get this sort i used
> @list_of_files=sort @list_of_files;
>
> sorted EMX-1.15.0.17.37-EMX-1.15.0.17.36.dlcwra
> > ($year, $month, $mday, $hour, $minute, $second, $timezone) =
> > /^Rates as of (\d+).(\d+).(\d+) (\d+):(\d+):(\d+) (\w+) (.*)$/;
> >
> > The following code is pointless:
> >
> > $year = $1;
> > $month = $2;
> > $mday = $3;
> > $hour = $4;
> >
> Microsoft Excel has the ability to import data via a web query. If I
create
> a query and run it on the following URL, a table with stock price
> information will be displayed on an Excel worksheet.
> http://finance.yahoo.com/q?s=%5EIXIC+%5EDJI+RHAT++&d=v1
> Now to the Perl/CGI question. What t
> If I define a function just in the freespace of a file and have
included in
> that file two packages which are bracketed in like:
>
> sub function {}
>
> package 1;
> {}
>
> package 2;
> {}
>
>
>
> How do I access the function (make a function call) from within one of
the
> packages?
>
> is it m
> [how to do it in ten seconds]
Randal just wants to take all the fun (and work)
out of creating solutions.
> printf OUTFILE "%s\,%s\,%s\,%s\,%s\,%s\,%s\n",
> $date, $time, $tz, $cur_sym, $cur_desc, $usd_unit, $units_usd;
>
> close(INFILE);
> close(OUTFILE);
> print STDERR "\n";
>
> 1;
You seem to be misunderstanding one particular
aspect of perl. Given the following:
while () {
# do some
> The second loop is executing. The TEST statement worked.
Ok.
> The Currency part of the email has a fixed format that is never
> deviated from:
>
> 1-3 $cur_sym
> 4 space
> 5-32 $cur_desc
> 33-35 (3) spaces
> 36-55 d8.d10 (.00)
> 56-58 (3) spaces
> 59-78 d8.d10 (.
> Got a combination that sort of works. It returns all the required
> fields but truncates any line where $usd_unit or $units_usd has more
> than 1 digit before the decimal point. There can be as many as (8)
> digits before and (10) digits after the decimal point in both cases.
>
> Here's the r
> while()
> {
> #if(#line I'm currently on is m/$searchstring/i)
> {
>print;
> }
>
> Now the problem is, how do I specify "The line I'm currently working
on"?
That's easy -- you don't.
When you said:
print;
you didn't specify what
> am I doing this right? I am looking to take the output from timex,
toss it
> into a hash keyed on the first field (real, user,sys)
> @timex = qx((timex ps -ef > /dev/null) 2>&1 );
The inner brackets are interpreted by the shell.
Can't help you there. My guess is you know
what you are doing in
According to my email client, this just arrived on the list:
From: "Cohan, Drew" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 16, 2001 2:20 PM
Subject: trying to convert characters into numbers based on a table
It's contents are just slightly different to the one that was al
> Randal
Well I'm not Randal, but I'm going to answer anyway...
> Would the same be possible for generating dynamic
> queries of web pages like amazon.
The points Randal made were:
1. Yahoo has URLs that return CSV files.
These are not web pages though the protocol
is http. The perl in
Stick a:
1;
at the end of the require'd file.
> I got a message when I run the perl script, I never got this msg
before, is
> there anyone can tell me why?
> How can I fix it?
> rplcstr.pl did not return a true value at replacestr.pl line 6
>
> Tips: on line 6
> [recursive procedure not localizing array passed as parameter]
> ---
> &buildBranch(@someNodes);
>
> sub buildBranch()
> {
> @numNodes = @_;
Use my @numNodes.
my declares a new private variable each time
it is encountered.
Without it, @numNodes is the same variable
each time the procedure g
> > I don't know about how XML::Parser handles memory - last time
> > I tried to use it to parse content.rdf from http://dmoz.org ,
> > it soaked up all my memory, then bombed. Sometimes, you need
> > to write your own parsing subs :)
>
> Is the file you referred to a really big file?
dmoz is
> Iv been givin this program to modify, but I can not astblish what some
parts
> of the program are doing. From
>
> printf
> to
> }
>
> Can any body help please and run through it with me pls!
>
>
>
> open iscd,"<$ARGV[0]" or die &qu
> Hi All,
>
> I have been asked to transform this bit of PERL coding into plain
english,
> Can someone help me please.
>
> Regards,
> Elaine.
Before anyone attempts an answer, are you a programmer?
Do you know what, say, parameters are?
> # Exit code for the ccount for
AME,
ADDRESS.
>
> The file contains the above 3 data types and about another 5, which I
need
> to get rid off!
>
> Can any body please suggest how do this task or what I need to read up
on
> (topics e.g. Report writing etc) or any other tutorials on report
writing
> or, any t
> Is there a Perl way to move a folder with out doing it one file at a
> time? (Similar to M$ Windows Explorer where you can drag a folder to
> another folder?)
In some cases:
rename $Old $New;
will work.
In some cases,
system ("mv $Old $New");
will work.
There's a bit more detail
> Here is two data examples from the input file
> (each data is normally streachted along ONE LINE) :
> (I need the three data types that are'underlined'
> (ID.NUMBER, BranchNAME, ADDRESS).
I don't see anything that is 'underlined'. So I can't
tell what's the id number etc. I assume the add
[plz keep everthing on list unless there's
a particularly good reason to go off list]
> > (I need the three data types that are'underlined' and are in
'font
> > size 14 large'
That sort of formatting doesn't work on this list.
(Btw, what you are calling 'data types' are really data items.
There's plenty of existing doc, but in the name of TMTOWTDI...
Asbestos suit donned. Criticisms welcome.
--
If you are wondering about things like:
use strict;
my $foo;
our $bar;
local $baz;
"explicit package"
then this article might be of help.
--
> #!/usr/bin/perl
> #
> # cur2csv.pl
> #
>
> use strict;
> use vars qw($started);
> use vars qw($cur_sym $cur_desc $usd_unit $units_usd);
> use vars qw($year $month $mday $hour $minute $second $timezone);
> use vars qw($conv_date $date $time $tz);
Instead of the battery of use vars, I suggest us
> Btw, what does the 'perl -wpi.bak' do in the following?
>
> perl -wpi.bak -e 'tr{abc def ghi jkl mno prs tuv wxy}
> {222 333 444 555 666 777 888 999}'
-wwarnings
-pi.bak filter file(s), saving old file(s) as *.bak.
By filter file(s), I mean do the bit after t
> How do I get access to the manpages please
Depends on the system, and you may not be
able to get access.
One normal access method is to enter, at a shell
prompt (command line):
man foo
to access the man page for foo.
Perl has its own equivalent of manpages. To start,
enter at a shell pr
d be
my @fields = split /*/;
> for (my $i = -1; $i > -9; --$i) {
>
> print $fields[$i] . "\n";
>
> }
>
> }
> Q IS this what you want me to change it to
>
> for (my $i = 0; $i > -3; $i >
-s
as in:
perl -e 'print "$_: " . -s . "\n" for (glob ("*.*"))'
> Hi,
>
> I would like to know if with a perl script you can get the size of a
file ?
> I need to get all the size of 250 files on 250 computers ...
>
> thanx
You need to make sure that variables in the called perl
code are unique to each instance of a call. (Sorry if that
was already obvious to you.)
I suggest you post the WriteFile code and we go from there.
> I have a few functions that are common to many different
> perl applications. All of thes
http://search.cpan.org/
> Im trying to write a perl script that will pull newspaper stories out
of a
> sybase database and post them on the web. I can connect to sybase,
pull
> stories, but they are in Rich Text Format. I would like to convert the
RTF
> to text or html. Could anyone
> sub WriteFile
> {
> my ($file,@lines) = @_;
> my ($line);
>
> open(FILE,">$file");
FILE is a problem.
If you are using perl 5.6 or later, you can do:
my $fh;
and then use $fh where you were using FILE, eg
open($fh, ">$file");
If you aren't using 5.6, it get
Ok, I entirely retract my post to which this is a reply.
Hey, I've been up all night.
If the scripts are running as separate processes,
then, well, I don't know.
> Does anyone know why perl behaves like this?
[see earlier posts in thread]
> Brutal critique enclosed... beware, I get right to the point. :)
Hmm, I enjoyed it, so I'm thinking I must
be more SM oriented than I thought...
> Me> # $_ is in main.
>
> $_ is always in main, even if the current package is something else.
Yes. I spent some time co
> while () {
>
> ($cur_sym, $cur_desc, $usd_unit, $units_usd) =
> /^([A-Z]{3})\s+([A-Za-z()\s]{28})\s+(\d+\.\d+)\s+(\d+\.\d+)/;
>
> # Strip the trailing spaces from $cur_desc
> StripTSpace($cur_desc);
>
> $cur_sym and $started++;
>
> printf OUTFILE "%s\,%s\,%s\,%s\,%s\,
> @$foo{bar}
What you intend by the above is the scalar value
in $foo{bar} dereferenced as an array by the @.
But that's not what happens. To achieve what you
want, use:
@{$foo{bar}}
The issue here is precedence of sigils (@, $, etc.)
versus subscript parens ({}, []), and the meaning
of va
> require "$LIBRARY_DIR/castime_html.pm";
> use CGI; # load CGI routines
> use strict 'vars';
> my $q = new CGI; # create new CGI object
>
> if (! $q->param()) {
> &draw_tnc();
> }
>
> So far so good except &draw_tnc() is in the required
> Hi
> Is there a module out there that will help me
> format data coming from an Access Database.
> Win32::OLE looks a bit daunting though I'm
> sure it will allow the typographic variety I'm
> looking for.
That's too vague.
Basically, please explain your cons
> there are some forms which execute a
> javascript on their SUBMIT button and
> the on executing them from my script
> it gives me an error that javascript is
> not supported like http, ftp or other
> protocols.
Is the word "javascript" anywhere in your perl sc
Do you mean use the result from such a call,
or how to do such a call? I'm guessing doing
the call, and a somewhat wild guess is:
HTTP::Status::status_message($rc)
Assuming $rc has been set to something
You may need to do a:
use HTTP::Status;
or similar, before you make the call.
And
> "use GDBM_File;" works OK
what did your tie statement look like?
> Is there any Module/Function that [...] interact with the
> sockets on remote machine?.
Yes, IO::Socket::INET.
> I am not able to find this function in IO::Socket::INET.
use IO::Socket;
$socket = IO::Socket::INET->new();
print $socket "question\n";
$answer = <$socket>;
> I want STDOUT to be sent to a FILESHANDLE. I have a script writing
output
> DISPLAY..But I wanna this to be going into a file through FILEHANDLES
..
>
> Ur Help is Highly APPRECIATED
Well I'll SEE if I can HELP YOU.
open(STDOUT, ">foo") or die "can't redirect STDOUT: $!";
HOPE THIS HELPS.
> I'm try my best
And you had 99% of it right.
> package pt;
> use 5.;
> $a="ok"; #for public using
> $b="It's";
>
> # I don't know why put the newsubroutine in this package,
> # perhaps, it is a constructer, I copy from PERL's manual,
> # but it seem don't do anything.
Most of what you w
Good job I decided to write this as two posts.
> Most of what you wrote is redundant in this
> particular case. You could have written:
(I was just refering to the constructor, btw.)
> package foo;
> sub bar { bless \$qux };
> .
> .
> package waldo;
> $emerson = foo->new
for replacing my line:
> print $c->displaysub().$a;
> you give me:
> print $c->displaysub().$ct::a;
> What is $ct? I'm afraid that it is an err in keyboard.
Oops, I meant pt. $pt::a means $a in package pt.
> And when I use the following line in pt.pm
> our $a;
> sys
> im a newbie to PERL.. right now, im learning it but i dont have any
exercises
> to work on. i need them because its how i learn.. can please someone
tell me
> what is a nice thing to do when you are still starting to learn PERL
and you
> want to enhance your skill
> Just a quick note; dont use $a and $b as named
> variables.. they're 'special' (used by the cmp
> operator) so to avoid ambiguity, use something
> else/more descriptive... or use $c if it makes you happy =)
Indeed, I meant to mention something about $a/$b myself.
cmp isn't really relevant.
$a
> > > Does anyone know why m//g only returns true on success instead of
> > > returning the number of matches like s///g and tr/// do.
> >
> > ...I can't think of any reason ... It just seems like it should.
>
> ... I think it's more a matter of usage --
I wrote this earlier, when no one had giv
> logo for learn.perl.orgl
What is the special message that learn.perl.org want
to convey (other than learn perl)?
In my last post, I wrote about the perl learning curve.
It is a fundamentally different shaped curve to most
other languages. This is the sort of fundamental issue
that learn.perl.o
> $done="false";
>
> while( $done eq "false ") {
> eval {
> ..
> .
> read form files.
> process info...
> write back to files
>
> };
> ( $@ ) ? ($done="false") : ($done="true");
>
> }
I don't understand why this isn't working. Cha
> 1. If we are after field 15, how comes you used field 14 in your
> answer please! *if ($fields[14] =~
/M/)***
The Nth element of an array is offset N-1.
So $foo[0] is the first element, $foo[1] is the second
and so on. This is a common practice in computing
la
> Hw could I copy a file in Perl
use File::Copy;
copy($file1, $file2);
> On Mon, Jun 25, 2001 at 12:12:19AM -0500, Me wrote:
> > > $done="false";
> > >
> > > while( $done eq "false ") {
> > > eval {
> > > ..
> > > .
> > >
> > $data = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239";
> >
> > @array = $data =~ /=(\d*)/g;
> >
> > print "$array[0], $array[1], $array[2]\n";
> and for esthetics:
>
> print join ',' @array;
>
> timtowtdi =)
Or
$_ = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239";
> But that wasnt the question man =)
> you print '230107312001,32,192,239'
>
> but the question was to just have: '32,192,239'
>
> -10 cookie points! ;-)
Oops, being careless.
You could throw away .*?= first:
$_ = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239";
s/.*?=//g;#
> s/.*?=//g;# remove leading junk
should of course be
> s/.*?=//;# remove leading junk
Ok, ok, I accept another -10 points. :< ;>
> [matching web page links]
> [using regexes]
Don't use regexes. They aren't the right tools for the task.
Use one of the cpan modules for parsing web pages.
Some are written specifically for pulling out links.
http://search.cpan.org/
> Drats - just when I got the regexp worked out too...
> $_=~ m/()/
Kudos for working out the regex that works given your
assumptions. If the web pages you will be parsing are
known to be constrained to the assumptions you've
established, then you're done.
But be aware that your regex will fail
> On Tue, 26 Jun 2001, Tim Wood wrote:
>
> > Drats - just when I got the regexp worked out too...
> > $_=~ m/()/
>
> Until you get to the one that is like
>
>
> a bunch of stuff
>
And of course, when you fix that simple exception,
the next slightly more complicated exception comes
along.
s the sub called from another
perl file? If so, and it used a different package name,
then that would explain the problem. Let me know if
this was the case, and we can go on from there.
> I don't know why it was not working earlier
> when emailLog = 'logs/email_log';
> was out of the sub block.
Did you use a 'package' command anywhere?
1 - 100 of 224 matches
Mail list logo