[17117] in Perl-Users-Digest
Perl-Users Digest, Issue: 4529 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 5 11:05:25 2000
Date: Thu, 5 Oct 2000 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970758309-v9-i4529@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 5 Oct 2000 Volume: 9 Number: 4529
Today's topics:
Re: Add on <yanick@babyl.sympatico.ca>
Re: Common constants in a separate file <mjcarman@home.com>
Re: counter can't be dispalyed <tony_curtis32@yahoo.com>
Re: date conversion <jeffp@crusoe.net>
Re: date conversion tjmurphy9677@my-deja.com
Re: Easy installation of modules <bmb@ginger.libs.uga.edu>
format question koldoon@my-deja.com
Re: format question <anders@wall.alweb.dk>
how to unlink this file? bing-du@tamu.edu
Re: how to unlink this file? <anders@wall.alweb.dk>
Re: How? Read a file from another server? <godzilla@stomp.stomp.tokyo>
Re: LWP ->How to stop a redirect and work with cookies (Randal L. Schwartz)
Re: LWP::UserAgent using GET to pass form variables <tony_curtis32@yahoo.com>
Re: LWP::UserAgent using GET to pass form variables <bruce_phipps@my-deja.com>
Re: making a HASH up <ren.maddox@tivoli.com>
Re: Massive kill Unix and Perl <gdaniell@wt.com.au>
Re: Newbie help please <newsposter@cthulhu.demon.nl>
Re: Perl and MySQL <hartleh1@westat.com>
Problem with Multi-subkey sorts tjmurphy9677@my-deja.com
Re: Problem with Multi-subkey sorts (Randal L. Schwartz)
Re: Problem with Multi-subkey sorts tjmurphy9677@my-deja.com
Problems with Perl2exe ... <tguirado@iterra-team.com>
Re: Quirk of strict ?? <ren.maddox@tivoli.com>
Re: Quirk of strict ?? <bmb@ginger.libs.uga.edu>
Re: Quirk of strict ?? (Sean McAfee)
Re: Reverse by paragraphs - NOT! ollie_spencer@my-deja.com
Re: sort <ren.maddox@tivoli.com>
Re: SSL with HTTP::Request::Common qw(POST) ? (Ben Coleman)
Re: What does PERL stand for? <sariq@texas.net>
Re: Win32::SerialPort Tutorial? <phil_xxx@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 05 Oct 2000 14:28:31 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: Add on
Message-Id: <je0D5.319841$1h3.7714515@news20.bellglobal.com>
kily@my-deja.com wrote:
: I puting the my file thing.pl is now:
: #!perl -p
: 's/.*\s+..(.*)/\L$1/'
: But at DOS prompt perl thing.pl <infile.txt>outfile.txt only copy
: infile.txt as it into outfile.txt without making any changement.
: -What is the problem?
Aah... I don't know how to break this to you but, you know,
the quotes around the s/ubs/titut/e operator? Well, it transforms
the said operator in a string. Your script is equivalent to
#! perl -p
"Could this be considered a subliminal message?"
The correct script is rather:
#! perl -p
s/.*\s+..(.*)/\L$1/;
Although I'm still partial to my first answer:
#!perl -p
/.*\s../;$_=lc$';
But then. s/.*\s+..(.*)/\L$1/ is probably easier to understand.
(question, though: isn't the + in \s+ overkill, as any superfluous
\s's will be slurped in by .*?)
: It is possible to put completely the in and out file in thing.pl
: and only type at DOS prompt: perl thing.pl?
Sure:
#!perl -w
open INFILE, "infile.txt" or die "Can't open infile.txt: $!\n";
open OUTFILE, ">outfile.txt" or die "Can't open outfile.txt: $!\n";
while(<INFILE>)
{
s/.*\s+..(.*)/\L$1/;
print OUTFILE;
}
or even:
#!perl
open STDIN, "infile.txt" and open STDOUT, ">outfile.txt";
/.*\s../ and print lc $' while <>;
Joy,
Yanick
--
($_,$y)=("Yhre lo .kePnarhtretcae\n", '(.) (.)' );
$y=~s/\(/(./gwhile s/$y/$2$1/xg;print; @ !;
" `---' ";
------------------------------
Date: Thu, 05 Oct 2000 08:10:45 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Common constants in a separate file
Message-Id: <39DC7DD5.3B222955@home.com>
James Taylor wrote:
>
> I want to keep a set of constants which are common to several scripts
> in a separate file in the same directory as the scripts themselves.
Simple enough.
> I did not want to go to the lengths of writing a full .pm module and
> reading up on how to use the Exporter
Why not? It isn't hard, and it's the right (IMHO) way to do this.
--------------------------------------------
package myconstants;
use strict;
use vars qw(@ISA @EXPORT);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw($DOMAIN $ADMIN_EMAIL);
use vars qw($DOMAIN $ADMIN_EMAIL);
$DOMAIN = 'doesnotwork.com';
$ADMIN_EMAIL = 'me@itwillneverwork.com';
1;
--------------------------------------------
And then, in your main script:
--------------------------------------------
#!/usr/local/bin/perl -w
use FindBin;
use lib "$FindBin::Bin";
use myconstants;
print "DOMAIN = $DOMAIN\n";
print "EMAIL = $ADMIN_EMAIL\n";
--------------------------------------------
It's the Exporter that magically gets your variables into the namespace
of your main script. One note: my sample module is really stripped down
to the bare minimums for what you're after. Don't use it as an example
for a "real" module, consult the docs for that.
And of course, if you *really* want to make them constants, declare them
that way:
use constant DOMAIN => 'doesnotwork.com';
-mjc
------------------------------
Date: 05 Oct 2000 08:28:15 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: counter can't be dispalyed
Message-Id: <87zokj2z9s.fsf@limey.hpcc.uh.edu>
>> On Thu, 05 Oct 2000 07:33:17 GMT,
>> amy_v@my-deja.com said:
> Hy all, I've had a CGI script that has to display a
> counter on my web page. The program works fine creating
> a file in the cgi-bin directory on my server. I've tried
> to put the counter on my page using an image with
> src=http://my server/cgi-bin/counter.pl, but it doen't
> work. What should I do???
Run, not walk, to comp.infosystems.www.authoring.cgi.
There's no perl issue here. You'd have the same problem
if you wrote the program in SNOBOL. You might also need
to visit
comp.infosystems.www.servers.<yourplatform>
hth
t
--
Namaste!
And an "oogabooga" to you too!
-- Homer Simpson
------------------------------
Date: Thu, 5 Oct 2000 10:16:19 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: date conversion
Message-Id: <Pine.GSO.4.21.0010051015060.14163-100000@crusoe.crusoe.net>
[posted & mailed]
On Oct 5, Yi Li said:
>03/Sep/2000:00:00:33
>
>How can I convert this to the number of seconds since mid night 1/1/1970?
Break it into pieces, convert the month name to a number (0 to 11),
subtract 1900 from the year, and use the Time::Local module:
use Time::Local
$seconds = timelocal($sec, $min, $hour, $day, $mon, $year);
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Thu, 05 Oct 2000 14:22:10 GMT
From: tjmurphy9677@my-deja.com
Subject: Re: date conversion
Message-Id: <8ri2q8$40b$1@nnrp1.deja.com>
In article <xl_C5.7996$4i5.408571@typhoon2.ba-dsg.net>,
"Yi Li" <heisyili@bellatlantic.net> wrote:
> I have a date/time like this:
>
> 03/Sep/2000:00:00:33
>
> How can I convert this to the number of seconds since mid night
1/1/1970?
> Thanks.
>
>
thing something like this will do it (haven't tested it)
add to top of file (below #!perl)
use Time::Local;
then use this to get epoc time (seconds since jan 1 1970
$mdaymon=substr("03/Sep/2000:00:00:33",0,7);
$therest=substr("03/Sep/2000:00:00:33",7,13);
($mday,mon)=split(/\//,$mdaymon);
($year,hour,$min,$sec)=split(/[:]/,$therest);
$epoc_error_time=timelocal($sec,$min,$hour,$mday,$mon,$year);
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 5 Oct 2000 09:30:38 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Easy installation of modules
Message-Id: <Pine.A41.4.21.0010050930150.12502-100000@ginger.libs.uga.edu>
On Thu, 5 Oct 2000, Pete Smith wrote:
> What I meant to say was:
>
> Can you put any module *in the same directory* as the script you are calling
> from, or do they have
> to be installed properly?
>
> Guess thats what happens when you post drunk :#)
>
> Pete (zoo.tv)
perldoc -q "How do I keep my own module/library directory?"
Brad
------------------------------
Date: Thu, 05 Oct 2000 14:09:52 GMT
From: koldoon@my-deja.com
Subject: format question
Message-Id: <8ri238$3ck$1@nnrp1.deja.com>
Hi,
when writing formatted text to a file handle, is it possible to force
a line feed and a header (TOP) at locations other than those that are
preset? If yes, then how?
thanks!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 5 Oct 2000 16:59:02 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: format question
Message-Id: <TH0D5.1879$UW.67433@news010.worldonline.dk>
koldoon@my-deja.com wrote:
> Hi,
>
> when writing formatted text to a file handle, is it possible to force
> a line feed and a header (TOP) at locations other than those that are
> preset? If yes, then how?
>
> thanks!
$perldoc perlform
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Thu, 05 Oct 2000 14:32:38 GMT
From: bing-du@tamu.edu
Subject: how to unlink this file?
Message-Id: <8ri3e6$4i1$1@nnrp1.deja.com>
I tried to use the following script to delete the
file
/usr/home/me/tmp/c24b18d4bb4afdf052330678af9a601d_attach_H:\tmp\zz.txt.
===============
#!/usr/local/bin/perl
$tmp = "/usr/home/me/tmp";
$uid = "c24b18d4bb4afdf052330678af9a601d";
unlink("$tmp/$uid_attach_*") || die "file can not be deleted\n";
exit;
===============
I got 'file can not be deleted'.
'Unlink' did not work either after I changed 'unlink' statement to:
unlink("$tmp/$uid\_attach\_*")
Any ideas?
Thanks,
Bing
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 5 Oct 2000 16:54:29 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: how to unlink this file?
Message-Id: <DD0D5.1046$u23.64916@news000.worldonline.dk>
bing-du@tamu.edu wrote:
> I tried to use the following script to delete the
> file
> /usr/home/me/tmp/c24b18d4bb4afdf052330678af9a601d_attach_H:\tmp\zz.txt.
>
> ===============
> #!/usr/local/bin/perl
>
> $tmp = "/usr/home/me/tmp";
> $uid = "c24b18d4bb4afdf052330678af9a601d";
>
> unlink("$tmp/$uid_attach_*") || die "file can not be deleted\n";
> exit;
> ===============
>
> I got 'file can not be deleted'.
>
> 'Unlink' did not work either after I changed 'unlink' statement to:
>
> unlink("$tmp/$uid\_attach\_*")
>
> Any ideas?
If some function fails to meet your expectations, it is likely - at least
in perl - that *you* made a mistake. Then you read the documentation for
that function.
From perldoc -f unink:
unlink <*.bak>;
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Thu, 05 Oct 2000 07:16:21 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How? Read a file from another server?
Message-Id: <39DC8D35.E4D35978@stomp.stomp.tokyo>
Bart Lateur wrote:
> Godzilla! wrote:
> >A Perl 5 Cargo Cultist will kill his program at
> >the drop of a hat. A programmer will do all she
> >can to keep her program alive and functioning.
> According to you, a "Cargo Cultist" is male, and a "porgrammer" is
> female.
> Sexist.
No. I did not say this. What I would say
is porgrammer is definitely a male quality.
Women use gudgrammer.
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: 05 Oct 2000 06:49:52 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: LWP ->How to stop a redirect and work with cookies
Message-Id: <m13dibgzy7.fsf@halfdome.holdit.com>
>>>>> "Wolfgang" == Wolfgang Schauer <w-s@gmx.de> writes:
Wolfgang> littlemanjohn@my-deja.com wrote in <8rh1bg$acr$1@nnrp1.deja.com>:
>> Is there an opposite to $ua->redirect_ok? I am trying to work cookies
>> of pages that have 301 and 302 redirects.
>> I've been trying various combinations using HTTP::Cookies and
>> LWP::UserAgent but can't get them to work together without being
>> redirected.
>> one of the many variations I've tried is below. Any help would be very
>> appreciated.
Wolfgang> you have to override the redirect_ok method in UserAgent:
Or, much simpler (after I slapped my forehead a few times after
writing code just like the above for a couple of of my WebTechniques
columns at <http://www.stonehenge.com/merlyn/WebTechniques/>)...
Use $ua->simple_request(@args) instead of $ua->request(@args). No
subclassing necessary!
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 05 Oct 2000 08:33:14 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: LWP::UserAgent using GET to pass form variables
Message-Id: <87wvfn2z1h.fsf@limey.hpcc.uh.edu>
>> On Thu, 5 Oct 2000 12:27:41 +0100,
>> "Bruce Phipps" <bruce_phipps@my-deja.com> said:
> Trying a simple script to post some values to a form
^^^^
> using LWP::UserAgent and GET
Now there's a hint :-)
> $Req->content('first=$Value1&second=$Value2');
content() is for POST.
If you want to use GET, look at the URI module which has
methods for setting the QUERY_STRING. Then you'd GET the
stringified form of the URI.
Or simply change the request to be POST instead of GET.
hth
t
--
Namaste!
And an "oogabooga" to you too!
-- Homer Simpson
------------------------------
Date: Thu, 5 Oct 2000 15:14:15 +0100
From: "Bruce Phipps" <bruce_phipps@my-deja.com>
Subject: Re: LWP::UserAgent using GET to pass form variables
Message-Id: <8ri2cq$sf7$1@sshuraac-i-1.production.compuserve.com>
Thanks, Tony.
Thats saved me a lot of time.
Bruce
------------------------------
Date: 04 Oct 2000 22:28:58 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: making a HASH up
Message-Id: <m3wvfodkzp.fsf@dhcp11-177.support.tivoli.com>
"Brian Canning" <bcanning@netresults-media.co.uk> writes:
> open (ADB, "Answers.txt") || die "Can't Open Answers.txt(r): $!\n";
> @thelist = ();
> while($ADataIn = <ADB>){
You probably want to add:
chomp $ADataIn;
> @AData = split(/\|/,$ADataIn);
> $thedata = "$AData[0] => $AData[1]";
> %thelist = push(@thelist, $thedata);
Change the above two lines to:
$thelist{$AData[0]} = $AData[1];
> }
> close ADB;
> print "174 = $thelist{174}<BR>";
> print "36 = $thelist{36}<BR>";
For more information, check out the docs:
perldoc perldata
<OPT>
Or, perhaps even better, replace the entire while loop with:
%theList = map { chomp; split /\|/ } <ADB>;
</OPT>
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 05 Oct 2000 22:20:59 +0800
From: Graham Daniell <gdaniell@wt.com.au>
Subject: Re: Massive kill Unix and Perl
Message-Id: <39DC8E4B.8E8B733A@wt.com.au>
Whoops - sorry!
If you had said RTFM I would have understood. I thought that there was
some wonderful resource out there that I was missing out on!!! (:-)>
Graham Daniell
Bernard El-Hagin wrote:
>
> On Tue, 03 Oct 2000 14:46:31 +0800, Graham Daniell <gdaniell@wt.com.au> wrote:
> >What is TFM
>
> TFM - the fucking manual.
>
> >and what is 'qx' ?
>
> RTFM and you'll find out (perldoc perlop). :)
> e
> a
> d
>
> >(Pardon my ignorance :-)
>
> Pardon my French.
>
> Cheers,
> Bernard
> --
> perl -le 'open JustAnotherPerlHacker,""or$_="B$!e$!r$!n$!a$!r$!d$!";
> print split/No such file or directory/;'
--
Graham Daniell
Perth, Western Australia
gdaniell@wt.com.au
------------------------------
Date: 5 Oct 2000 14:11:19 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Newbie help please
Message-Id: <8ri267$n2h$1@internal-news.uu.net>
Drew Simonis <simonis@myself.com> wrote:
> suma@secondring.com wrote:
>>
>> Please help me out
>> bigsuma@home.com
> Your problem is obvious. Can't you see it?
Priblem is Compulsive spamming?
Solution: remove internet access
Erik
------------------------------
Date: Thu, 05 Oct 2000 09:57:37 -0400
From: hartley_h <hartleh1@westat.com>
Subject: Re: Perl and MySQL
Message-Id: <39DC88D1.DFDD0CC1@westat.com>
Atul wrote:
>
> Folks,
>
> are there any example perl scripts which makes
> use of MySQL ?? ... just to help me get started.
There is a link from the main DBI page
<http://www.symbolstone.org/technology/perl/DBI/> to "Jeffrey Baker's
DBI Examples and Performance Tuning" page at
<http://www.saturn5.com/~jwb/dbi-examples.html>. It is not specific to
MySQL but covers DBI in general. Still, I suspect it would prove quite
useful.
Mark-Jason Dominus has written a Short guide to DBI at
<http://www.perl.com/pub/1999/10/DBI.html>.
Also, I recommend _Programming_the_Perl_DBI_ by Alligator Descartes &
Tim Bunce and published by O'Reilly. A sample chapter can be found at
<http://www.oreilly.com/catalog/perldbi/chapter/ch04.html>. I found
this book to be very helpful.
I'm sure there are many more good references but if you read and
understand those three you should not have any problems getting started.
--
Henry Hartley
------------------------------
Date: Thu, 05 Oct 2000 14:06:52 GMT
From: tjmurphy9677@my-deja.com
Subject: Problem with Multi-subkey sorts
Message-Id: <8ri1tl$33e$1@nnrp1.deja.com>
hi, i've got a flat file that contains the folling records
#-----#------------------------#---#-#----------#
1 :message 1 of 6 25 chars :dzz:N:file1.txt :60
20 :message 2 of 6 :dzz:N:file2.txt :61
19 :message 3 of 6 :dzz:N:file3.txt :484
23 :message 4 of 6 :zae:N:file4.txt :1000
13 :message 5 of 6 that goes:zab:N:file10.txt:15
30 :message 6 of 6 :aac:N:file9.txt :2000
i want to sort the data based on the 4th field (dzz) and if there are
two records with matching 4th fields then i want to sort these matching
records based on the first field, i'm using the following sort:
@lines=sort{ substr($b,32,34) cmp substr($a,32,34)
|| substr($a,0,5) <=> substr($b,0,5) } @lines;
trouble is - this is the output - it is not sorting on the ID field
correctly
23 :message 4 of 6 :zae:N:file4.txt :1000
13 :message 5 of 6 that goes:zab:N:file10.txt:15
19 :message 3 of 6 :dzz:N:file3.txt :484
20 :message 2 of 6 :dzz:N:file2.txt :61
1 :message 1 of 6 25 chars :dzz:N:file1.txt :60
30 :message 6 of 6 :aac:N:file9.txt :2000
does the || work like this? I was expecting record with ID 20 to be
before record with ID 19 i.e. expected output
23 :message 4 of 6 :zae:N:file4.txt :1000
13 :message 5 of 6 that goes:zab:N:file10.txt:15
20 :message 2 of 6 :dzz:N:file2.txt :61
19 :message 3 of 6 :dzz:N:file3.txt :484
1 :message 1 of 6 25 chars :dzz:N:file1.txt :60
30 :message 6 of 6 :aac:N:file9.txt :2000
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 05 Oct 2000 07:25:31 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Problem with Multi-subkey sorts
Message-Id: <m1k8bnfjqc.fsf@halfdome.holdit.com>
>>>>> "tjmurphy9677" == tjmurphy9677 <tjmurphy9677@my-deja.com> writes:
tjmurphy9677> @lines=sort{ substr($b,32,34) cmp substr($a,32,34)
Do you really want 34 characters starting at column 32? The substr()
third parameter is a length, not an ending position.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 05 Oct 2000 14:53:49 GMT
From: tjmurphy9677@my-deja.com
Subject: Re: Problem with Multi-subkey sorts
Message-Id: <8ri4ln$5nb$1@nnrp1.deja.com>
that was it - using substr incorrectly
cheers,
tony
In article <m1k8bnfjqc.fsf@halfdome.holdit.com>,
merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "tjmurphy9677" == tjmurphy9677 <tjmurphy9677@my-deja.com>
writes:
>
> tjmurphy9677> @lines=sort{ substr($b,32,34) cmp substr
($a,32,34)
>
> Do you really want 34 characters starting at column 32? The substr()
> third parameter is a length, not an ending position.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
777 0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 5 Oct 2000 16:46:15 +0200
From: "T. GUIRADO" <tguirado@iterra-team.com>
Subject: Problems with Perl2exe ...
Message-Id: <8ri4g7$jlh$1@s1.read.news.oleane.net>
Thanks to reply directly by Email, at vbezard@iterra-team.com
Well,
I've got CGI programs in PERL, and I don't want someone to be able to read
my codes. So, I've tried Perl2exe ... It seems working well, but sometimes,
I have problems ...
Does someone have experience with Perl2exe ??
Does someone have another idea to make my codes unreadable?
Thnaks in advance ...
Vincent
------------------------------
Date: 04 Oct 2000 21:55:39 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Quirk of strict ??
Message-Id: <m3aeckf13o.fsf@dhcp11-177.support.tivoli.com>
Barry <barry.allebone@DB.COM> writes:
> Global symbol $c requires explicit package name at ./t1.pl line 6.
>
> This I understand but why not similar error messages for $a and $b ?
$a and $b receive special dispensation because of their special
meaning to sort.
perldoc -f sort
(note especially the paragraph about $a and $b toward the end)
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 5 Oct 2000 11:04:32 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Quirk of strict ??
Message-Id: <Pine.A41.4.21.0010051054080.12502-100000@ginger.libs.uga.edu>
On Thu, 5 Oct 2000, Peter Sundstrom wrote:
> If you're using strict, you <MUST NOT> declare $a
> and $b as lexicals. They are package globals.
Perhaps a bit too strong a statement.
1 #!/usr/local/bin/perl -w
2 use strict;
3
4 my @a = qw( 9 8 7 6 5 4 3 2 1 0 );
5 print sort { $a <=> $b } ( @a );
6 print "\n";
7
8 my $a = "hello ";
9 my $b = "world.\n";
10
11 print $a, $b;
Works just fine.
However,
1 #!/usr/local/bin/perl
2
3 my $a = "hello ";
4 my $b = "world.\n";
5
6 my @a = qw( 9 8 7 6 5 4 3 2 1 0 );
7 print sort { $a <=> $b } ( @a );
8 print "\n";
9
10 print $a, $b;
Does not. You must not declare $a and $b as lexicals in the same scope as
a sort routine that uses $a and $b. This is true even if you don't use
strict or -w.
Brad
------------------------------
Date: Thu, 05 Oct 2000 15:04:31 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Quirk of strict ??
Message-Id: <3M0D5.5877$O5.124745@news.itd.umich.edu>
In article <8rgsgs$sdc$1@hermes.nz.eds.com>,
Peter Sundstrom <peter.sundstrom@eds.com> wrote:
>If you're using strict, you <MUST NOT> declare $a
>and $b as lexicals. They are package globals.
You actually can make $a and $b lexicals; you just have to refer to the
global ones in your sort routine.
------------------------------------------------------------
use strict;
my ($a, $b);
my @arr1 = (1 .. 10);
my @arr2 = sort { $::b <=> $::a } @arr1;
print "@arr2\n";
------------------------------------------------------------
--
Sean McAfee mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!
------------------------------
Date: Thu, 05 Oct 2000 14:20:10 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Reverse by paragraphs - NOT!
Message-Id: <8ri2mh$3tp$1@nnrp1.deja.com>
Thanks for the posting. I think.
Yes, I read each made to me, reserving first priority to those that
were are on subject. Second priority went to those that prefer person
attacks to technical input ( like this one) and after that, I don't
even read Godzilla's works of fiction.
This is as yet a bit difficult, since I seldom need to post, finding
most answers thru search engines. I'm still getting used to the
non-linear method used by my-deja to post the messages. I expected
later messages to post at the bottom of the list, and am only lately
catching up to some I overlooked.
I can only post in mornings and evenings- sometimes at lunch or breaks-
since my I have committments to my employer.
You seem never to have experienced learning cycles. If so, you are
indeed fortunate. I'm forever in one or another. One thing for sure:
I'll go along way before beginning another string on perl.misc.
Many helpful replies have suggested interesting topics and stimulated
new lines of thought. Most responders, however, seem a priori angry
and intent on criticizing syntax, grammar, or simply polishing their
ego than in engaging in technical dialog.
If you feel I have overlooked someone, or a point made by some previous
poster, please be specific - I will reread it and see if I agree.
A personal note ( since this reply is to an attack on me):
I have been using interpretive languages in my engineering work since
'70, beginning with APL and progressing through BASIC(ugh), REXX, and
maybe a few others. I use linux, AIX, HP-UX, and NT platforms for the
perl programs I code, simply since it is superior to any multi-platform
interpretive code I have encountered (I have yet to evaluate python,
though I understand it is superior to perl for code > 100 lines).
I detected what I thought was a inconsistency in perl's implementation
of the reverse operator and appealed to the forum for enlightenment. I
have yet to get that enlightenment, but I sure learned a lot about
"reverse" and it's limitations. It simply can't "reverse by paragraph"
lines already in an array - I think I outline why in one of the posts I
made above.
Whoops, I'm getting technical. Perhaps you aren't ready for that. I
don't exactly have your credentials.
ollie spencer
In article <8rhkbf$aul$1@lublin.zrz.tu-berlin.de>,
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> <ollie_spencer@my-deja.com> wrote in comp.lang.perl.misci, still
stubbornly
> posting jeopardy style:
>
> >Thanks for the reply. I believe you might actually have read my
original
> >posting! Many seem to have not.
>
> Did you read the replies you got?
>
> >Thanks again! I'll post my results-I never thought to slurp a para
at a
> >time!
>
> How about the half-dozen or so postings that suggested just that?
>
> Anno
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 04 Oct 2000 22:21:10 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: sort
Message-Id: <m31yxwezx5.fsf@dhcp11-177.support.tivoli.com>
"Jeff Rutledge" <jrutled@home.com> writes:
> I would like to create a flat file in UNIX with one or more ' ls -al'
> commands and alphabetically sort each line by the right-most field example:
>
> /../../../.../filename
>
> Some directories will be deeper than others so I will not be able to specify
> a field number. My objective is determine whether or not there are
> duplicate files in a file system. Any help would be greatly appreciated.
There are lots of ways. One is to use something like:
print "$_\n" for sort {
substr($a, rindex($a, "/")) cmp substr($b, rindex($b, "/"))
} @files;
Assuming you already have the data in @files...
A ST or GRT might be useful:
ST (Schwartzian Transform):
print "$_\n" for map $_->[1]
=> sort { $a->[0] cmp $b->[0] }
map [ substr($_, rindex($_, "/")), $_ ]
=> @files;
GRT (Guttman-Rosler Transform):
print "$_\n" for map substr($_, index($_, "/"))
=> sort
map substr($_, rindex($_, "/")+1) . $_
=> @files;
For more information, see
http://www.hpl.hp.com/personal/Larry_Rosler/sort/sorting.html
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 05 Oct 2000 14:22:50 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: SSL with HTTP::Request::Common qw(POST) ?
Message-Id: <39dc8e5a.60606627@localhost>
On Wed, 04 Oct 2000 00:10:27 GMT, irf@netexecutive.com wrote:
>unfortunately, $content ends up being :
>"501 (Not Implemented) Protocol scheme 'https' is not supported"
Do you have Crypt::SSLeay or IO::Socket::SSL installed?
Ben
------------------------------
Date: Thu, 05 Oct 2000 14:07:55 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: What does PERL stand for?
Message-Id: <39DC8B3B.5E0478E9@texas.net>
Tigz wrote:
>
> Well i have asked my question in the subject line.
Perle Systems Limited, listed on the NASDAQ.
HTH. HAND.
- Tom
------------------------------
Date: Thu, 05 Oct 2000 13:27:39 GMT
From: Phil xxx <phil_xxx@my-deja.com>
Subject: Re: Win32::SerialPort Tutorial?
Message-Id: <8rhvk3$11p$1@nnrp1.deja.com>
In article <slrn8tnppc.2f0.efflandt@efflandt.xnet.com>,
efflandt@xnet.com wrote:
> On Mon, 02 Oct 2000 21:45:46 -0400, MC <mc@backwoods.org> wrote:
> >Can anyone point me to a tutorial or reference on the
Win32::SerialPort module
> >other than the POD material. The POD material just ~barely~ covers
the bones of
> >it and is rather less than clear as to the usage of many of the
functions. I've
> >managed, ~finally~, to make a basic script work, but thats as far as
I can go
> >w/o better documentation.
>
> Device::SerialPort for Unix based on Win32::SerialPort comes with
numerous
> examples in an 'eg' subdir of the module source. I wonder where
similar
> examples end up when you install Win32::SerialPort:
>
> eg/any_os.plx - cross-platform "conditional use" demo
> eg/demo1.plx - talks to a "really dumb" terminal
> eg/demo2.plx - "poor man's" readline and chatV
> eg/demo3.plx - looks like a setup menu - but only looks :-(
> eg/demo4.plx - simplest setup: "new", "required param"
> eg/demo5.plx - "waitfor" and "nextline" using lookfor
> eg/demo6.plx - basic tied FileHandle operations, record separators
> eg/demo7.plx - a Perl/Tk based terminal, event loop and callbacks
> eg/demo8.plx - command line terminal emulator with Term::Readkey
> eq/options.plx - post-install test that prints available options
> eg/example1.txt - examples from The Perl Journal #13
> eg/example2.txt - (minimal mods for cross-platform use)
> eg/example3.txt
> eg/example4.txt
> eg/example5.txt
> eg/example6.txt
> eg/example7.txt
> eg/example8.txt
>
> --
> David Efflandt efflandt@xnet.com http://www.de-srv.com/
>
>
Have you any examples of how to use program modems in asynchronous mode.
on unix. ie. have 2 chanels/devices for the one com port, one for input
and another for output. Also do you know how to do a non blocking read
on the device so that I can write to it at the same time?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4529
**************************************