[28044] in Perl-Users-Digest
Perl-Users Digest, Issue: 9408 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 30 00:06:07 2006
Date: Thu, 29 Jun 2006 21:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 29 Jun 2006 Volume: 10 Number: 9408
Today's topics:
Re: crash on async in taint mode <benmorrow@tiscali.co.uk>
Re: Debugging Memory consumption for Perl Program <janicehwang1325@yahoo.com>
Re: deflate parts of a file <paul.marquess@btinternet.com>
Deleting duplicate values in hash of hashes <sunckell@gmail.com>
Re: Deleting duplicate values in hash of hashes <mumia.w.18.spam+nospam.usenet@earthlink.net>
Re: Malformed utf8; where's the null byte coming from? <benmorrow@tiscali.co.uk>
Re: Malformed utf8; where's the null byte coming from? <benmorrow@tiscali.co.uk>
Re: Malformed utf8; where's the null byte coming from? bill_mckinnon@interloper.net
Re: Perl Object Creation problem... <tadmc@augustmail.com>
Re: Perl Object Creation problem... <howachen@gmail.com>
Re: prematurely closed filehandle <rvtol+news@isolution.nl>
Re: prematurely closed filehandle <tadmc@augustmail.com>
Printing a postscript file with Win32::Printer paul.dorman@gmail.com
Re: Professional IDE for a cross-platform Perl applicat <noreply@invalid.net>
Re: Professional IDE for a cross-platform Perl applicat <christoph.lamprecht.no.spam@web.de>
providig a filename as an argument fom the command line <qbert@comcast.net>
Re: providig a filename as an argument fom the command <jurgenex@hotmail.com>
Re: providig a filename as an argument fom the command <qbert@comcast.net>
stuck in a while loop <nospam@home.com>
Re: What is Expressiveness in a Computer Language [corr rossberg@ps.uni-sb.de
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 Jun 2006 08:18:39 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: crash on async in taint mode
Message-Id: <ffbcn3-geo.ln1@osiris.mauzo.dyndns.org>
Quoth "Brian McCauley" <nobull67@gmail.com>:
>
> Yohan N. Leder wrote:
> > To replace a fork() which crashes ActivePerl 5.8.8 in taint mode, I've
> > tried to go through creation of a thread... And it crashes too !
> >
> > #!/usr/bin/perl -wT
> > use threads;
> > print "Content-type: text/html\n\n";
> > my $thr = async{print "<p>thread in progress...</p>"};
> > die "thread failure\n" unless defined($thr);
> > $thr->detach();
> > sleep(1);
> > print "<p>main in progress...</p>";
> > exit 0;
> >
> > ActivePerl falls in exception on async{} block.
> > What's wrong again ?
>
> Windows doesn't have a real fork(). It is emulated with threads, so I
> suspect you are seeing the same bug.
http://perlmonks.org/index.pl?node_id=547313
Ben
--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
benmorrow@tiscali.co.uk
------------------------------
Date: 29 Jun 2006 18:07:55 -0700
From: "janicehwang1325@yahoo.com" <janicehwang1325@yahoo.com>
Subject: Re: Debugging Memory consumption for Perl Program
Message-Id: <1151629675.415106.175150@m73g2000cwd.googlegroups.com>
Thank you. It's very useful!!
Bart Van der Donck wrote:
> janicehwang1325@yahoo.com wrote:
>
> > I would like to know is there any way to debug the memory consumption
> > of a perl program running? For example, I have a program running and i
> > would like to keep tract of the memory consumption of this program so
> > that I can retart the program if the memory consumption is going to
> > high. Thank you very much.
>
> Yes, there are a number of techniques for that. See:
>
> http://perldoc.perl.org/perldebguts.html#Debugging-Perl-memory-usage
>
> --
> Bart
------------------------------
Date: Thu, 29 Jun 2006 23:06:05 +0100
From: Paul Marquess <paul.marquess@btinternet.com>
Subject: Re: deflate parts of a file
Message-Id: <44a44ecd$0$11539$4d4eb98e@read.news.uk.uu.net>
sid wrote:
> use Compress::Zlib ;
> binmode STDIN;
> binmode STDOUT;
> $x = deflateInit()
> or die "Cannot create a deflation stream\n" ;
> while (<>)
> {
> ($output, $status) = $x->deflate($_) ;
>
>
> $status == Z_OK
> or die "deflation failed\n" ;
> print $output ;
> }
> ($output, $status) = $x->flush() ;
> $status == Z_OK
> or die "deflation failed\n" ;
> print $output ;
OK, *that* deflate :-)
> --------------------------------------------------------------
> My code is based on this:
> while(<>){
> if(begin_xmltag)then set flag
> if(flag){$string.=$_}
> else {print $_}
> if(end_xmltag) {
> set output to compressed string using deflate procedre
> print $output
> do a flush on the deflate stream
After the flush, do you then print the output that the flush has generated?
> set string to null
> }
> }
Without seeing the actual code its difficult to tell the problem.
>
> Paul Marquess wrote:
>> "sid" <sridhara@yahoo.com> wrote in message
>> news:1151596999.818114.126060@y41g2000cwy.googlegroups.com...
>> >I need to compress parts of a file, say some sections of an xml file
>> > while leaving others as ASCII on the ouput stream. I took the deflate
>> > example from cpan
>>
>> Which deflate example are you referring to?
>>
>> >and started gathering all lines of a section in a
>> > string and then doing one deflate, ouput, flush and output the
>> > compressed section. But this doesn't seem to be working. I am seeing
>> > "use of uninitialized values" warnings and the final output file
>> > doesn't look right.
>> > I would see some compressed data then a whole bunch
>> > of xml without any compressed data in between and so forth.
>>
>> Can you post some code please?
>>
>> > The
>> > compress method has a horrible performance. It actually made the file
>> > much bigger.
>> > Hence I only want to use the deflate method. It works fine
>> > on the whole file.
>>
>> Compression isn't worth the effort on small strings. Ending up with
>> something bigger is one of the main reasons for not doing it.
>>
>> > But I want to use it on sections of a file. Are
>> > there examples that someone can point me to?
>>
>> Paul
------------------------------
Date: 29 Jun 2006 11:08:08 -0700
From: "sunckell" <sunckell@gmail.com>
Subject: Deleting duplicate values in hash of hashes
Message-Id: <1151604488.790248.125300@i40g2000cwc.googlegroups.com>
hello everyone,
Not sure how I can do this in the most efficient way. Hoping
someone will enlighten me on how I can go about doing it..
I have written a script on a sendmail 'gateway' server. (gateway for
an Exchange backend.) The script creates a report of all the
successfully transmitted emails to three particular email addresses.
Here is what I do...
First I read through the mail log file and search for all the
message id's for each of the three email addresses. Since the
information I need is not contained in one single line of the mail log,
I re-read the mail log , skipping any line that does not pertain to
what I am looking for.
The second time reading the log file I generate a hash of hashes..
$HoH{$msgid}{exchange} = The id the Exchange server assigned to the
email.
$HoH{$msgid}{year}
$HoH{$msgid}{day}
$HoH{$msgid}{time}
$HoH{$msgid}{status}
The problem I am having is that MS Exchange is sending multiple
messages, where the $HoH{$msgid}{exchange} is the same value, but the
$HoH{$msgid} value is different.
Is there a way I can remove duplicate $HoH{$msgid}{exchange} values is
the message id is different?
I thought I could see if it was defined before I populated the hash..
But I am not even getting close to the results I thought I would get..
code...
if($text =~ /^to\=</){
#check status first.
my $status = (split /stat\=/, $text)[1];
if ($status =~ /Sent\s\(/){
$HoH{$msgid}{status} = $status;
$HoH{$msgid}{date} = $date;
$HoH{$msgid}{time} = $time;
$HoH{$msgid}{year} = $year;
}else{
# we don't care about no delivered.
next;
}
#grab the email address
my($eMail) = (split /\s+/, $text)[0];
#clean up the output a little
$eMail =~ s/to\=<//;
$eMail =~ s/>,//;
$HoH{$msgid}{email} = $eMail;
}
#add exchange id to the hash.
if($text =~ /msgid\=</){
my($exchange) = (split /\s+/, $text)[4];
#clean up the output a little
$exchange =~ s/msgid\=<//;
$exchange =~ s/>,//;
## Thought I could determine if $exchange existed and not add
it.
$HoH{$msgid}{exchange} = $exchange;
next;
}
Thanks for the help...
Sincerely,
sunckell
------------------------------
Date: Thu, 29 Jun 2006 21:18:27 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Deleting duplicate values in hash of hashes
Message-Id: <DsXog.228$cd3.95@newsread3.news.pas.earthlink.net>
sunckell wrote:
> hello everyone,
Hello
>
> $HoH{$msgid}{status}
> [...]
> The problem I am having is that MS Exchange is sending multiple
> messages, where the $HoH{$msgid}{exchange} is the same value, but the
> $HoH{$msgid} value is different.
>
> Is there a way I can remove duplicate $HoH{$msgid}{exchange} values is
> the message id is different?
>
> I thought I could see if it was defined before I populated the hash..
> But I am not even getting close to the results I thought I would get..
> [...]
Create a hash of exchanges and check that an item is not already in the
exchanges hash before adding it to the HoH.
------------------------------
Date: Thu, 29 Jun 2006 07:48:37 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Malformed utf8; where's the null byte coming from?
Message-Id: <5n9cn3-geo.ln1@osiris.mauzo.dyndns.org>
Quoth Ben Morrow <benmorrow@tiscali.co.uk>:
>
> Quoth bill_mckinnon@interloper.net:
> > I've spent some time trying to understand Perl's Unicode support and
> > its nuances, and I think I actually understand some amount of it. But
> > the behavior of this snippet of code is puzzling me at the moment:
> >
> > --
> > #!/usr/local/bin/perl -w
> >
> > use Encode qw(decode);
> >
> > $s = decode('utf8', "Version"); # String w/utf8 flag set
> > $s =~ s/v\xc3\x83//i;
> > --
> >
> > Running this with Perl 5.8.6 on Linux (and Windows) produces this
> > warning:
> >
> > $ ./test.pl
> > Malformed UTF-8 character (unexpected non-continuation byte 0x00,
> > immediately after start byte 0xc3) in substitution (s///) at ./test.pl
> > line 7.
> > $
>
> Some more data points: 5.8.7 i686-linux
>
> 1. There is no need for Encode.
>
> my $s = "foo";
> utf8::upgrade($s);
>
> works fine (in the sense that it fails).
>
> 2. It only fails if the first character matches. This makes sense...
>
> 3. It only fails if there are zero-or-one characters after the \xc3.
> Putting a second stops the warning.
>
> 4. It still fails if the \xc3 is the first character (and the string is
> modified to match, obviously).
>
> 5. The match does not have to be at the start of the string.
>
> 6. \xf3 behaves the same way (the number of expected continuation bytes
> doesn't matter).
Sorry, one more:
7. The warning only occurs when the /i flag is used.
> I believe this is a bug: anyone else?
Ben
--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* benmorrow@tiscali.co.uk *
------------------------------
Date: Thu, 29 Jun 2006 07:51:32 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Malformed utf8; where's the null byte coming from?
Message-Id: <ks9cn3-geo.ln1@osiris.mauzo.dyndns.org>
Quoth "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>:
> bill_mckinnon@interloper.net wrote:
> > I've spent some time trying to understand Perl's Unicode support and
> > its nuances, and I think I actually understand some amount of it. But
> > the behavior of this snippet of code is puzzling me at the moment:
> >
> > --
> > #!/usr/local/bin/perl -w
> >
> > use Encode qw(decode);
> >
> > $s = decode('utf8', "Version"); # String w/utf8 flag set
> > $s =~ s/v\xc3\x83//i;
> > --
> > [...]
>
> I was able to eliminate the warning by using "use encoding 'utf8'," but
> there is a problem with the substitution.
>
> use Encode qw(decode);
> use encoding 'utf8';
> my $s;
>
> # rx is "vÃ"
> my $rx = qq{"v\xc3\x83"};
> $s = decode('utf8', "V\x{c3}\x{83}ersion"); # String w/utf8 flag set
These two do not match. The regex matches a 3-char string; $s (after
decoding) has only one char between the V and the e.
> print 'rx : ', $rx, "\n";
> print 'before: ', $s, "\n";
> $s =~ s/v\xc3\x83//i;
> print 'after : ', $s, "\n";
>
> __END__
>
> This prints this:
> rx : "vÃ"
> before: V�ersion
> after : �ersion
>
> Notice that the "�" wasn't substituted even though the 'V' was. Why?
Again, I think it's a bug. No substitution should have occurred, as the
regex didn't match.
Ben
--
I touch the fire and it freezes me, [benmorrow@tiscali.co.uk]
I look into it and it's black.
Why can't I feel? My skin should crack and peel---
I want the fire back... Buffy, 'Once More With Feeling'
------------------------------
Date: 29 Jun 2006 13:48:45 -0700
From: bill_mckinnon@interloper.net
Subject: Re: Malformed utf8; where's the null byte coming from?
Message-Id: <1151614125.464648.56940@i40g2000cwc.googlegroups.com>
Ben Morrow wrote:
> Again, I think it's a bug. No substitution should have occurred, as the
> regex didn't match.
Lacking any reasonable explanation to the contrary, this is my
theory too. : ) It looks like "perlbug" is the recommended way of
reporting bugs in Perl...I'll try to run through this at some point (I
should probably confirm it happens on the latest and greatest Perl,
etc). Thanks for the responses...
- Bill
------------------------------
Date: Thu, 29 Jun 2006 18:59:43 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl Object Creation problem...
Message-Id: <slrnea8qbf.12v.tadmc@magna.augustmail.com>
howa <howachen@gmail.com> wrote:
>
> lawre...@hummer.not-here.net ???
>
>> "howa" <howachen@gmail.com> writes:
>> >
>> > it seems a little stupid if the class name must be the package full
>> > name...
>> >
>>
>> Perhaps this will offer enlightenement:
>>
>> Suppose I have two classes Road::Apple and Fruit::Apple
>>
>> #/usr/local/bin/howas-private-perl-like-language
>> use Road::Apple;
>> use Fruit::Apple;
>>
>> my $thing = new Apple;
>>
>> What kind of apple whould $thing be?
I don't think that was a rhetorical question, but you did not
address it.
What kind of apple whould $thing be?
>> One is delicious, the other not
>> so much.
[snip .sig, you are not supposed to quote those you know]
> in other language, you also have this problem, java or c.
^^^^
What is with the "also" there?
Perl does not have that problem.
> in fact, this is not a problem at all,
Then what kind of apple whould $thing be?
A red one or a brown one?
If the programmer cannot tell, then it looks like a problem to me...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Jun 2006 19:35:45 -0700
From: "howa" <howachen@gmail.com>
Subject: Re: Perl Object Creation problem...
Message-Id: <1151634945.866932.306970@m73g2000cwd.googlegroups.com>
Tad McClellan =E5=AF=AB=E9=81=93=EF=BC=9A
> howa <howachen@gmail.com> wrote:
> >
> > lawre...@hummer.not-here.net ???
> >
> >> "howa" <howachen@gmail.com> writes:
> >> >
> >> > it seems a little stupid if the class name must be the package full
> >> > name...
> >> >
> >>
> >> Perhaps this will offer enlightenement:
> >>
> >> Suppose I have two classes Road::Apple and Fruit::Apple
> >>
> >> #/usr/local/bin/howas-private-perl-like-language
> >> use Road::Apple;
> >> use Fruit::Apple;
> >>
> >> my $thing =3D new Apple;
> >>
> >> What kind of apple whould $thing be?
>
>
> I don't think that was a rhetorical question, but you did not
> address it.
>
> What kind of apple whould $thing be?
>
>
> >> One is delicious, the other not
> >> so much.
>
>
> [snip .sig, you are not supposed to quote those you know]
>
>
> > in other language, you also have this problem, java or c.
> ^^^^
>
> What is with the "also" there?
>
> Perl does not have that problem.
>
>
> > in fact, this is not a problem at all,
>
>
> Then what kind of apple whould $thing be?
>
> A red one or a brown one?
>
> If the programmer cannot tell, then it looks like a problem to me...
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
did you even have experience on java or c? (no offense)
how they handle namespace/package/import/include ?
of coz perl has more then one way to do it, but seems the way how perl
handle it is not a good solution.
------------------------------
Date: Thu, 29 Jun 2006 21:32:40 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: prematurely closed filehandle
Message-Id: <e81gv5.1ag.1@news.isolution.nl>
Jim Moon schreef:
> I have determined the cause of the error. It was a permissions issue.
> Hence "Bad file descriptor". I rarely work with Perl, so my
> familiarity is minimal. It is an interesting and useful language
> though!
Another pointer: perldoc -q browser
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Thu, 29 Jun 2006 19:07:30 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: prematurely closed filehandle
Message-Id: <slrnea8qq2.12v.tadmc@magna.augustmail.com>
Jim Moon <please.reply@to.group> wrote:
> "Jim" <jmoon@uab.edu> wrote in message
Please choose one posting address and stick with it.
>>> This script (below) runs fine from the command line, but not in IIS,
^^^^^^^^^^^^
perldoc -q "command line"
My CGI script runs from the command line but not the browser. (500
Server Error)
> I have determined the cause of the error. It was a permissions issue.
Then it was not a Perl problem.
> Hence "Bad file descriptor". I rarely work with Perl,
That is irrelevant, since you did not have a Perl problem to begin with.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Jun 2006 18:29:16 -0700
From: paul.dorman@gmail.com
Subject: Printing a postscript file with Win32::Printer
Message-Id: <1151630956.056295.272430@d56g2000cwd.googlegroups.com>
Hi all,
upon discovering (to my horror) that Win32::Printer::Direct does not
respect the configuration set in the Printers and Faxes dialogue (such
as the source and output tray), I proceeded to look at using
Win32::Printer do do the job.
The method that seems most promising is the Inject method, which
appears to let you inject raw postscript data into the job. I would
like to inject contents of the file I have so that it's data is the
only thing that gets sent to the printer.
No matter what I have tried though, the page comes out blank.
Has anyone managed to use Win32::Printer to print a postscript file
loaded from disk? I need to either specify the source and output tray,
*or* have the current settings in the Printer and Faxes dialogue
respected. I also don't want to have to share the printers as this
would be politically incorrect where I work.
Examples would be very, *very* welcome.
Regards,
Paul
------------------------------
Date: Thu, 29 Jun 2006 22:00:02 GMT
From: Ala Qumsieh <noreply@invalid.net>
Subject: Re: Professional IDE for a cross-platform Perl application
Message-Id: <C3Yog.57570$Lm5.42019@newssvr12.news.prodigy.com>
Bob wrote:
> Hello,
>
> I have a 15 years old application that I have written in perl without
> any IDE. This
> application has a PostgreSQL database as server side, a tk-based
> client, and
> both run on linux only. I feel trapped, because
Hmm .. I don't think Perl/Tk is 15 years old, but I digress :)
> - the client is not compiled, and thus runs slowly;
Compiling won't speed it up. You have to look at where your client is
spending most of its time, and optimize that code.
> - the client must now run also on osx and windows, natively;
Perl is cross-platform for the most part. So unless you hard-code
linux-specific stuff, or you use platform-dependent modules, your code
should run fine on other platforms.
> - the client's tk-based gui is limited, but I have no clue about
> cross-platform alternatives;
Tk runs on most, if not all, platforms that Perl runs on. It certainly runs
well on windows, *nix and OSX. No need for alternatives.
> - each time I try to port it to windows or osx I get missing components
> and misbehaviours.
First thing, I guess, is to install any missing modules. What kind of
misbehaviours are you seeing?
> How do I reshape the client so that I can develop it in one machine and
> generate
> reliable and installable executables for other platforms?
make sure you don't use any platform-specific code, unless you have to. If
you do, then make sure you isolate the code, using something like
(untested):
BEGIN {
if ($^O =~ /win/i) {
require Win32::Specific::Module;
} elsif ($^O eq 'linux') {
require Linux::Specific::Module;
}
}
--Ala
------------------------------
Date: Fri, 30 Jun 2006 00:23:20 +0200
From: Ch Lamprecht <christoph.lamprecht.no.spam@web.de>
Subject: Re: Professional IDE for a cross-platform Perl application
Message-Id: <e81jsm$mi6$2@online.de>
Bob wrote:
> Hello,
>
> I have a 15 years old application
> This
> application has a PostgreSQL database as server side, a tk-based
> client,
> I feel trapped, because
> - the client is not compiled, and thus runs slowly;
> - the client must now run also on osx and windows, natively;
> - the client's tk-based gui is limited, but I have no clue about
> cross-platform alternatives;
> - each time I try to port it to windows or osx I get missing components
> and misbehaviours.
I use perl-tk 804 for a Pg client application and haven't encountered these
problems yet. The Tk-GUI is times faster than the Network / Server side.
I would recommend, that you do some profiling on your applications code to see
which parts of your code take most of its time. Otherwise you might be
disappointed after working for days on another GUI.
Porting from/to Linux/Windows works perfectly without changing any Tk-related code.
There is c.l.p.tk for perl-tk questions.
Christoph
--
perl -e "print scalar reverse q/ed.enilno@ergn.l.hc/"
------------------------------
Date: Thu, 29 Jun 2006 22:35:26 -0400
From: "Jockser" <qbert@comcast.net>
Subject: providig a filename as an argument fom the command line
Message-Id: <4qKdnbWrlbV-EDnZnZ2dnUVZ_sWdnZ2d@comcast.com>
I'm trying to find a way to run a perl.pl script using a file name as an
argument.
Such as:
myperlprogram.pl somefile.xml
The somefile.xml would need to be assigned to a variable in the perl
program.
This is on a Win32 system that I will later be converting the
myperprogram.pl to an .exe program using the pp function in PAR.
Thanks.
------------------------------
Date: Fri, 30 Jun 2006 02:52:27 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: providig a filename as an argument fom the command line
Message-Id: <Ll0pg.8851$uo.448@trnddc07>
Jockser wrote:
> I'm trying to find a way to run a perl.pl script using a file name as
> an argument.
> myperlprogram.pl somefile.xml
>
> The somefile.xml would need to be assigned to a variable in the perl
> program.
perldoc perlvar ===> @ARGV
jue
------------------------------
Date: Thu, 29 Jun 2006 23:41:32 -0400
From: "Jockser" <qbert@comcast.net>
Subject: Re: providig a filename as an argument fom the command line
Message-Id: <5r2dnZ6qm7D4ADnZnZ2dnUVZ_oKdnZ2d@comcast.com>
THANKS!!!
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:Ll0pg.8851$uo.448@trnddc07...
> Jockser wrote:
>> I'm trying to find a way to run a perl.pl script using a file name as
>> an argument.
>> myperlprogram.pl somefile.xml
>>
>> The somefile.xml would need to be assigned to a variable in the perl
>> program.
>
> perldoc perlvar ===> @ARGV
>
> jue
>
------------------------------
Date: Fri, 30 Jun 2006 02:59:51 GMT
From: "Nospam" <nospam@home.com>
Subject: stuck in a while loop
Message-Id: <Hs0pg.74458$uP.55118@newsfe2-gui.ntli.net>
Can anyone identify what is wrong with code, or worse how to fix it?, it
worked one time, but not anymore, I have hardly made any changes
#! perl\bin\perl
use strict;
use warnings;
use Data::Dumper;
use WWW::Mechanize;
use LWP::Useragent;
open (FILE2, "text1.txt") or die "couldn't open $!";
use constant START => "<FILE2>";
while()
{
my $mech = WWW::Mechanize->new( );
my @url;
my $START = <FILE2>;
print "$START \n";
(my $varia1 = $START) =~ s/\@.*//;
print "$varia1 \n";
$mech->get('http://www.loginurl');
$mech->form(1);
$mech->field('login',"$varia1");
if ($mech->success){ print "login successfully set \n";} else{print $!;}
$mech->submit();
if ($mech->success){ print "login successfully submitted \n";} else{print
$!;}
$mech->follow_link( text_regex => qr/Daily news/i);
if ($mech->success){ print "link successfully followed \n";} else{print
$!;}
my ($content3) = $mech->content() =~ /= "(.*)r"/;
my @content1 = $content3;
foreach my $content2 (@content1) {
open (FILE, ">> hm5.txt");
print $content2."\n";
print FILE $content2."\n";
last;
}
}
close FILE2;
close FILE;
------------------------------
Date: 29 Jun 2006 14:10:08 -0700
From: rossberg@ps.uni-sb.de
Subject: Re: What is Expressiveness in a Computer Language [correction]
Message-Id: <1151615408.920886.237600@y41g2000cwy.googlegroups.com>
Joe Marshall wrote:
> Andreas Rossberg wrote:
> >
> > Which is why this actually is a very bad example to chose for dynamic
> > typing advocacy... ;-)
>
> Actually, this seems a *good* example. The problem seems to be that
> you end up throwing the baby out with the bathwater: your static type
> system stops catching the errors you want once you make it powerful
> enough to express certain programs.
That is not the case: you can still express these programs, you just
need to do an indirection through a datatype.
- Andreas
------------------------------
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 V10 Issue 9408
***************************************