[30101] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1344 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 8 18:09:43 2008

Date: Sat, 8 Mar 2008 15:09:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 8 Mar 2008     Volume: 11 Number: 1344

Today's topics:
    Re: CGI file based logging <hjp-usenet2@hjp.at>
    Re: CGI file based logging <ben@morrow.me.uk>
    Re: FAQ 4.53 How do I manipulate arrays of bits? <hjp-usenet2@hjp.at>
    Re: FAQ 4.53 How do I manipulate arrays of bits? <uri@stemsystems.com>
    Re: FAQ 5.2 How do I change, delete, or insert a line i (Hannes =?utf-8?Q?H=C3=B6rl?=)
    Re: FAQ 5.3 How do I count the number of lines in a fil sheinrich@my-deja.com
    Re: Inverted RegEx on list of numbers (David Combs)
    Re: Inverted RegEx on list of numbers <damian@tvk.rwth-aachen.de>
    Re: Perl pattern extraction <someone@example.com>
    Re: Perl pattern extraction <syscjm@sumire.gwu.edu>
    Re: Perl pattern matching and extraction <noreply@gunnar.cc>
    Re: regexp for s/// <hjp-usenet2@hjp.at>
        TieRegistry Overlapped Error <XXjbhuntxx@white-star.com>
        try to use "locale" with german and coepage 437 (dos) <wuendi@googlemail.com>
    Re: Using Perl to get data from website <fiazidris@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 8 Mar 2008 19:29:22 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: CGI file based logging
Message-Id: <slrnft5mo4.p1p.hjp-usenet2@hrunkner.hjp.at>

On 2008-03-05 06:33, Frank Seitz <devnull4711@web.de> wrote:
> howa wrote:
>> 
>> I have a CGI which is targeted to log some messages to a file, since
>> Apache are running at multi-process, are there any modules which can
>> handle file locking issue if I received many requests?
>
> Why use a module? It's simple to implement with Perl's
> file locking interface. See "perldoc -f flock".
>
> use strict;
> use warnings;
>
> use Fcntl qw/:flock/;
>
> open my $fh,'>>','file.log' or die $!; # open file
> flock $fh,LOCK_EX or die $!;           # lock file
> print $fh "message\n" or die $!;       # write file
> close $fh or die $!;                   # close file

At least on unixish systems locking the file isn't necessary if you can
ensure that you always write a log entry with a single write(2) system
call. PerlIO seems to do this if you open a file in raw mode:

#!/usr/bin/perl
use strict;
use warnings;
use IO::Handle;

open my $fh, ">:raw", "foo.out";
$fh->autoflush(1);

my $s = "a" x 100 . "\n";
print $fh $s;

$s = "a" x 10_000 . "\n";
print $fh $s;

$s = "a" x 1000;
print $fh $s, $s, $s, $s, "\n";
__END__

strace shows:

write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 101) = 101
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 10001) = 10001
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 1000) = 1000
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 1000) = 1000
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 1000) = 1000
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 1000) = 1000
write(3, "\n", 1)                       = 1

The first and second writes correlate to the first and second print statement.
The next 5 writes correlate to the 5 arguments of the third print statement.

Remove ":raw" from th open call and the strace output looks like this:

write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 101) = 101
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 4096) = 4096
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 4096) = 4096
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 1809) = 1809
write(3, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"..., 4001) = 4001

The first print statement is again turned into single write call. But the
second string (being longer than the buffer length) is split into three
write calls, and the 5 arguments of the third print statement (being
shorter than the buffer length) are gathered into a single write call.

	hp



------------------------------

Date: Sat, 8 Mar 2008 19:22:08 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: CGI file based logging
Message-Id: <0k5ba5-jj7.ln1@osiris.mauzo.dyndns.org>


Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
> 
> At least on unixish systems locking the file isn't necessary if you can
> ensure that you always write a log entry with a single write(2) system
> call. PerlIO seems to do this if you open a file in raw mode:

A safer way to ensure this is to use the :unix mode, which makes print
(et al) call write(2) directly.

Ben



------------------------------

Date: Sat, 8 Mar 2008 22:06:38 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 4.53 How do I manipulate arrays of bits?
Message-Id: <slrnft5vuu.p1p.hjp-usenet2@hrunkner.hjp.at>

On 2008-03-05 00:20, Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
>
>  MD> On Tue, 04 Mar 2008 18:14:18 GMT, Uri Guttman <uri@stemsystems.com>
>  MD> wrote:
>
>  >> and even using it for select is not a good example since IO::Select is
>  >> so much easier to use. only people like me who know select very well
>  >> (over 20 years of coding with it in c and perl) use it directly.
>
>  MD> Surely true, but so crankish sounding...
>
> you would be cranky if you had to write event loops with the select api
> (in any language). if you go further back it used to only support 32
> handles as they used a single word for the bit maps!

I don't remember that and my memory of select also goes back about 20
years. In fact the first version of select I do remember didn't have any
arbitrary limit (you passed in pointers to unsigned int and a count)
unlike the stupid fd_sets.

	hp


------------------------------

Date: Sat, 08 Mar 2008 21:30:57 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: FAQ 4.53 How do I manipulate arrays of bits?
Message-Id: <x7y78saooe.fsf@mail.sysarch.com>

>>>>> "PJH" == Peter J Holzer <hjp-usenet2@hjp.at> writes:

  PJH> On 2008-03-05 00:20, Uri Guttman <uri@stemsystems.com> wrote:
  >>>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
  >> 
  MD> On Tue, 04 Mar 2008 18:14:18 GMT, Uri Guttman <uri@stemsystems.com>
  MD> wrote:
  >> 
  >> >> and even using it for select is not a good example since IO::Select is
  >> >> so much easier to use. only people like me who know select very well
  >> >> (over 20 years of coding with it in c and perl) use it directly.
  >> 
  MD> Surely true, but so crankish sounding...
  >> 
  >> you would be cranky if you had to write event loops with the select api
  >> (in any language). if you go further back it used to only support 32
  >> handles as they used a single word for the bit maps!

  PJH> I don't remember that and my memory of select also goes back about 20
  PJH> years. In fact the first version of select I do remember didn't have any
  PJH> arbitrary limit (you passed in pointers to unsigned int and a count)
  PJH> unlike the stupid fd_sets.

that version took a pointer to an array of ints and the count specified
the length of the array. i don't recall using the oldest version (i
started on bsd 4.1) which supported only a single int of handle mask
bits. this was an obvious limitation that they didn't plan for when the
sockets api was first created in early BSD (i think in the 2.x
versions). remember, back then the whole idea of a multisocketed server
was novel and no one know how important it would become. it was one of
the first available OS's to support ethernet and tcp/IP. others
supported them but were proprietary or experimental.

i am not sure how i would google for old bsd api docs. i leave that as
an exercise to the reader :)

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Architecture, Development, Training, Support, Code Review  ------
-----------  Search or Offer Perl Jobs  ----- http://jobs.perl.org  ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Sat, 08 Mar 2008 22:44:58 +0000
From: nospam@tugraz.at (Hannes =?utf-8?Q?H=C3=B6rl?=)
Subject: Re: FAQ 5.2 How do I change, delete, or insert a line in a file, or append to the beginning of a file?
Message-Id: <yluer6ekx2c5.fsf@jonfen.knupf.com>

PerlFAQ Server <brian@stonehenge.com> writes:

[...]

>       To prepend lines to the beginning, print those lines before you enter
>       the loop that prints the existing lines.
>
>             open my $in,  '<',  $file      or die "Can't read old file: $!";
>             open my $out, '>', "$file.new" or die "Can't write new file: $!";
>
>             print "# Add this line to the top\n"; # <--- HERE'S THE MAGIC

Shouldn't it read

              print $out "# Add this line to the top\n"; # <--- HERE'S THE MAGIC
                    ^^^^

here?

>     To change existing lines, insert the code to modify the lines inside the
>     "while" loop. [...]
>
>             while( <$in> )
>                     {
>                     print $out $_;
>                     }

[...]

>             open my $in,  '<',  $file      or die "Can't read old file: $!";
>             open my $out, '>', "$file.new" or die "Can't write new file: $!";
>
>             print "# Add this line to the top\n";

Same as above:
              print $out "# Add this line to the top\n";
                    ^^^^

>             while( <$in> )
>                     {
>                     s/\b(perl)\b/Perl/g;
>                     print $out $_;
>                     }

Ciao,
  hoeha


------------------------------

Date: Sat, 8 Mar 2008 08:21:45 -0800 (PST)
From: sheinrich@my-deja.com
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <50876b3e-45f6-4198-bdef-a57c495316e9@y77g2000hsy.googlegroups.com>

On Mar 8, 2:54 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth sheinr...@my-deja.com:
>
>
>
> > On Mar 6, 3:03 am, PerlFAQ Server <br...@stonehenge.com> wrote:
>
> > > --------------------------------------------------------------------
>
> > > 5.3: How do I count the number of lines in a file?
>
> > >     One fairly efficient way is to count newlines in the file. The following
> > >     program uses a feature of tr///, as documented in perlop. If your text
> > >     file doesn't end with a newline, then it's not really a proper text
> > >     file, so this may report one fewer line than you expect.
>
> > >             $lines = 0;
> > >             open(FILE, $filename) or die "Can't open `$filename': $!";
> > >             while (sysread FILE, $buffer, 4096) {
> > >                     $lines += ($buffer =~ tr/\n//);
> > >                     }
> > >             close FILE;
>
> > >     This assumes no funny games with newline translations.
>
> > > --------------------------------------------------------------------
>
> > Doesn't it maybe make a difference (regarding performance) whether I'm
> > writing
> > $lines += ($buffer =~ tr/\n/\n/);
> > ?
>
> Nope. That does exactly the same thing.
>
> > More often than never I find myself musing if a substitution with a
> > replacement of same size could be more performant than others. I think
> > that this might prevent costly block-shiftings on large data.
>
> > Also, tr/// (and s///) might be possibly optimized by shifting to a
> > 'count-mode' if it is detected that the pattern and the replacement
> > both are hardcoded and are the same.
>
> tr/// with empty replacement and without /d and m// in scalar context
> (with no capturing parens) are the operators you are looking for. Both
> just count, and don't replace anything.
>
> Ben

Indeed, I never realized that.

From perlfaq4, there is also a suggestion to count multi-byte
patterns:
<cite>
How can I count the number of occurrences of a substring within a
string?
  There are a number of ways, with varying efficiency. If you want a
count
  of a certain single character (X) within a string, you can use the
  "tr///" function like so:

	  $string = "ThisXlineXhasXsomeXx'sXinXit";
	  $count = ($string =~ tr/X//);
	  print "There are $count X characters in the string";

  This is fine if you are just looking for a single character.
However, if
  you are trying to count multiple character substrings within a
larger
  string, "tr///" won't work. What you can do is wrap a while() loop
  around a global pattern match. For example, let's count negative
  integers:

	  $string = "-9 55 48 -2 23 -76 4 14 -44";
	  while ($string =~ /-\d+/g) { $count++ }
	  print "There are $count negative numbers in the string";

  Another version uses a global match in list context, then assigns
the
  result to a scalar, producing a count of the number of matches.

		  $count = () = $string =~ /-\d+/g;
</cite>

Thank you,

Steffen


------------------------------

Date: Sat, 8 Mar 2008 18:08:01 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: Inverted RegEx on list of numbers
Message-Id: <fqukm1$fid$1@reader2.panix.com>

In article <61gjiuF1vl8a9U1@mid.dfncis.de>,
Damian Lukowski  <damian@tvk.rwth-aachen.de> wrote:
>Damian Lukowski schrieb:
>> If I'm not mistaken 
>> the complementary regex to /two/ is something like 
>> /^(?:[^t]|t+[^tw]|(?:t+w)+([^to]|t+[^tw]))*(?:t+w)+o/.
>> 
>> Damian
>
>Well, I am mistaken here, as I forgot an important step. :)
>I won't correct it, because it will be more complicated as it is already. :)

C'mon, give it a shot.

   After all, you did suck us into this.   :=)

And as something to add to a regexp-tutorial, describe
how your existing line was supposed to work and accomplish --
and then what was wrong with it.

As you attach your fix, sequential thinking to it, with
the pros and cons you went through on the way there.


Of course no one would have time to do such a thing,
but maybe the idea of that kind of annotation will
stick in someone's head, and actually be done from
time to time.


David




------------------------------

Date: Sat, 08 Mar 2008 19:42:22 +0100
From: Damian Lukowski <damian@tvk.rwth-aachen.de>
Subject: Re: Inverted RegEx on list of numbers
Message-Id: <63g50fF27o0p8U1@mid.dfncis.de>

David Combs schrieb:
> C'mon, give it a shot.
> 
>    After all, you did suck us into this.   :=)
> 
> And as something to add to a regexp-tutorial, describe
> how your existing line was supposed to work and accomplish --
> and then what was wrong with it.


Well, okay.

The rough approach to invert a regular expression is this:

- Convert the regex to an equivalent epsilon-NFA.
- Eliminate epsilon transitions.
- Convert NFA to equivalent DFA.
- Invert final state(s) to nonfinal state(s) and vice versa.
- Convert the inverted DFA back into a regular expression.

Above, I forgot the fourth step and converted a DFA into a regular 
expression without inverting any states. Thus, the former /two/ should 
be equivalent to the bloated one.

Damian


------------------------------

Date: Sat, 08 Mar 2008 18:01:05 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Perl pattern extraction
Message-Id: <BvAAj.90028$C61.20924@edtnps89>

Deepan - M.Sc(SE) - 03MW06 wrote:
> Hi,
> 
>      my $url = "/pages-cell.net/deepan/sony/";
> 
>      if($url =~ m/\/(.*)\//g)
>      {
>     		my @result = $1;
>             	return @result;
>      }
> 
> What i need is that i should be able to get anything that is between /
> and /. Here i should be able to get pages-cell.net,deepan,sony into
> @result but something is wrong somewhere. Please help me to solve
> this?

my @result = $url =~ /[^\/]+/g



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


------------------------------

Date: Sat, 08 Mar 2008 20:38:09 -0000
From: Chris Mattern <syscjm@sumire.gwu.edu>
Subject: Re: Perl pattern extraction
Message-Id: <slrnft5u9h.7jf.syscjm@sumire.gwu.edu>

On 2008-03-08, Deepan - M.Sc(SE) - 03MW06 <deepan.17@gmail.com> wrote:
> Hi,
>
>      my $url = "/pages-cell.net/deepan/sony/";
>
>      if($url =~ m/\/(.*)\//g)
>      {
>     		my @result = $1;
>             	return @result;
>      }
>
> What i need is that i should be able to get anything that is between /
> and /. Here i should be able to get pages-cell.net,deepan,sony into
> @result but something is wrong somewhere. Please help me to solve
> this?
>
No.  m\/(.*)\//g only returns one string; m *always* only returns one
string.  In this case, the pattern will match one /, as many characters
as possible, including / (because * is greedy), and then another /.  
Therefore, $1 will be "pages-cell.net/deepan/sony".  Why in the world 
would you expect to be able to get an array (@result) from a scalar ($1)?

perldoc -f split should tell you about what you need to be using.

-- 
             Christopher Mattern

NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities


------------------------------

Date: Sat, 08 Mar 2008 15:21:55 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl pattern matching and extraction
Message-Id: <63flsoF272tl0U1@mid.individual.net>

[ You shouldn't have started a new thread for the same problem! ]

Deepan - M.Sc(SE) - 03MW06 wrote:
> Hi,
>      I would like to thank everyone for their help to my previous
> post. Actually i didn't explained my need completely. Here's it
> 
>      my $url = "/pages-cell.net/deepan/sony/";
> 
>      if($url =~ m/\/(.*)\//g)
>      {
>                 my @result = $1;
>                 return @result;
>      }
> 
> What i need is that i should be able to extract "sony" from it. In the
> sense i should be able to extract whatever that is available in the
> last between "/" and "/". Please help me to solve this.

This can still be easiest solved with split().

     ( split /\//, $url )[-1]

Otherwise you can do:

     if ( $url =~ m#.*/(.+)/# ) {
         print "$1\n";
     }

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Sat, 8 Mar 2008 21:54:25 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: regexp for s///
Message-Id: <slrnft5v81.p1p.hjp-usenet2@hrunkner.hjp.at>

On 2008-03-07 00:52, Petr Vileta <stoupa@practisoft.cz> wrote:
> John W. Krahn wrote:
>> $ perl -le'
>> for my $string ( "A: aaa B: bbb", "A: aaa", "B: bbb", "B: bbb A: aaa"
>>     ) { my ( $myA, $myB ) = $string =~
>>     /(?=.*A:\s*(\S+))?(?=.*B:\s*(\S+))?/; print qq[\$string =
>>     "$string"     \$myA = "$myA"     \$myB = "$myB"]; }
>> '
>> $string = "A: aaa B: bbb"     $myA = "aaa"     $myB = "bbb"
>> $string = "A: aaa"     $myA = "aaa"     $myB = ""
>> $string = "B: bbb"     $myA = ""     $myB = "bbb"
>> $string = "B: bbb A: aaa"     $myA = "aaa"     $myB = "bbb"

> What Perl version you use John? In my Perl 5.6.1 this not work and print 
> already $myA='' $myB=''

You must have a very peculiar version of perl 5.6.1, which is different
from everybody else's perl 5.6.1. I am beginning to suspect that it
exists only in your head.

	hp



------------------------------

Date: Sat, 08 Mar 2008 16:42:18 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: TieRegistry Overlapped Error
Message-Id: <Xns9A5B588DAC39ccruizermydejacom@207.115.17.102>

I'm trying to read the reg values on a remote server using 
Win32::TieRegistry. I can remotely connect from my computer using regedit. 
When I run the following, I get an error.

use diagnostics;
use Win32::TieRegistry(Delimiter=>"/");

use strict;

my ($reg_test, $reg_val);
my $server = 'some_server_name';
my $key_name = 
'HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Control/ServiceCurrent';

$reg_test = $Registry->{"//$server/$key_name"} || die "Could not access 
remote machine: $^E\n";

$reg_val = $reg_test->GetValue("Content Type");
print "REMOTE: $reg_test\t$reg_val\n";

exit 0;


This is the error I'm getting:

C:\test\reg_audit>reg_audit.pl
Uncaught exception from user code:
        Could not access remote machine: Overlapped I/O operation is in  
progress

 at C:\test\reg_audit\reg_audit.pl line 10 


Any suggestions?



------------------------------

Date: Sat, 8 Mar 2008 08:47:37 -0800 (PST)
From: =?ISO-8859-1?Q?mathias_w=FCndisch?= <wuendi@googlemail.com>
Subject: try to use "locale" with german and coepage 437 (dos)
Message-Id: <f804b656-70fb-4209-ab50-4f25a4349455@m3g2000hsc.googlegroups.com>

Hi,

i look for informations about the use of the perl pragma "locale". the
reason why: i have old input data coded with codepage 437. and i want
to use the normal matchingcharacter \b (non alphabetic char) and \w
(alphabetic char).
i found a lot of site about posix under linux but i work under windows
xp. am i the first with this problem?
i want to tell perl what byte between 32 and 255 is a allphabetical
character (\w) and what is not (\b).
thanks for ideas.

bye, mathias



------------------------------

Date: Sat, 8 Mar 2008 07:34:29 -0800 (PST)
From: ifiaz <fiazidris@gmail.com>
Subject: Re: Using Perl to get data from website
Message-Id: <fec6994a-58af-40f6-862f-e0ac6b151db1@s19g2000prg.googlegroups.com>

Also, please so you know,

my $baseurl =
    'http://www.bangkokflightservices.com/our_cargo_track&trace.php';
my $hawb = 'h_prefix=HAWB&h_sn=';

h_prefix should be HWB and not HAWB.

I have fixed that in my code and still the same problem that it throws
me to a different page.



On Mar 7, 9:46 pm, ifiaz <fiazid...@gmail.com> wrote:
> You may need to adjust the follow_link call if there are several links
> on
> the same page that match that regex; see perldoc WWW::Mechanize for
> the
> arguments. If the server checks the Referer, you may also need to ->get
>
> /our_cargo_track.php first.
>
> Ben
> ----
>
> Thank you for your prompt response.
>
> When I used the code with minor modifications, I still have the
> problem that I can't access the data as the process throws me to
> another page as below.
>
> This is what the $content contains:
>
>                 <script> window.open ('http://www.bangkokflightservices.com/
> our_cargo_track.php') ;
>                         setTimeout("window.close();", 10);
>                 </script>
>
> How to get to the actual data page. Please guide me here as I am a
> newbie.
>
> I don't know how to implement Referer and all that.
>
> ### This is the complete code I used.
> #!/usr/bin/perl
>
> use WWW::Mechanize;
>
> my $baseurl =
>     'http://www.bangkokflightservices.com/our_cargo_track&trace.php';
> my $hawb = 'h_prefix=HAWB&h_sn=';
>
> my $M = WWW::Mechanize->new(auto_check => 1);
>
>         ## Added code for testing Only
>         my $F = WWW::Mechanize->new(auto_check => 1);
>         $F->get("http://www.bangkokflightservices.com/our_cargo_track.php");
>         my $contentF = $F->content;
>         #print "$contentF\n";
>         #$M->add_header("Referer => 'http://www.bangkokflightservices.com/
> our_cargo_track.php'" )
>
> while (<>) {
>     chomp;
>
>     my ($mprefix, $msn) = /(...)-(........)/ or do {
>         warn "invalid MAWB: '$_'";
>         next;
>     };
>
>     print "$mprefix $msn\n";
>
>     $M->get("$baseurl?m_prefix=$mprefix&m_sn=$msn&$hawb");
>     $M->follow_link(url_regex => qr/showc_track/);
>     my $content = $M->content;
>
>     print "$content\n"; # for debugging
>
>     # process $content as before
>     #
>       while ( $content =~ m#(.*)#g ) {
>             $currline=$1;
>
>             if ($currline =~ m#style12#i) {
>
>                 $currline =~ m#.*>(.*?)<.*#i;
>                     $result = $result . " / " . $1;
>             }
>     }
>     print "***$result\n";
>     $result = '';
>
> }



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 1344
***************************************


home help back first fref pref prev next nref lref last post