[22971] in Perl-Users-Digest
Perl-Users Digest, Issue: 5191 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 7 18:05:56 2003
Date: Mon, 7 Jul 2003 15: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)
Perl-Users Digest Mon, 7 Jul 2003 Volume: 10 Number: 5191
Today's topics:
Re: Completely confused - system and $? == -1 <rick.delaney@rogers.com>
Crypt::OpenPGP memory use <bing-du@tamu.edu>
Re: Getting the size of files from a list? (Math55)
Google's newsgroups <REMOVEsdnCAPS@comcast.net>
Re: Google's newsgroups <abigail@abigail.nl>
Hanging pipes in CGI Perl <cbaegert-pas-de-spam@europeanservers.net>
Re: How differ these lwp queries? <bdonlan@bd-home-comp.no-ip.org>
Re: How differ these lwp queries? dkoleary@attbi.com
Re: How do I clone a structure? <tassilo.parseval@rwth-aachen.de>
Re: LWP, cookies, and adding to request string <spam@thecouch.homeip.net>
microphone input <0114372622@iol.it>
Re: my first japh <abigail@abigail.nl>
Re: naming hash using a variable name. (Tad McClellan)
Re: oneliner failed on Win2k with space in path name <tnitzke@att.net>
Re: oneliner failed on Win2k with space in path name <spam@thecouch.homeip.net>
Perl Script Problems <yyyy@yyy.com>
Re: Perl Script Problems <abigail@abigail.nl>
Re: references => how not to destroy my data ? (Glenn Jackman)
Re: references => how not to destroy my data ? <REMOVEsdnCAPS@comcast.net>
Re: regex and parsing (Tad McClellan)
Re: STDIO problem <prlawrence@lehigh.edu>
Re: Using semicolon delimited autosplit "perl -aF\;" <krahnj@acm.org>
Wanted: Help/Script to truncate mp3 files. <shurrell@tbpl.thunder-bay.on.ca>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 07 Jul 2003 19:56:11 GMT
From: Rick Delaney <rick.delaney@rogers.com>
Subject: Re: Completely confused - system and $? == -1
Message-Id: <m3vfueglgk.fsf@biff.bort.ca>
"Matthew O. Persico" <persicom@acedsl.com> writes:
> Matthew O. Persico wrote:
> DB<2> n
> AMG::System::system(/am/common/lib/site_perl/5.6.1/AMG/System.pm:119):
> 119: waitpid($pid,0);
> DB<2> n
> AMG::System::system(/am/common/lib/site_perl/5.6.1/AMG/System.pm:120):
> 120: my $status = $?;
> DB<2> print $! + 0 . "->$!"
> 10->No child processes
>
> No child processes? What the ...? The process was out there; the
> waitpid() call waited until the job was finished and the work that the
> job was supposed to do was done. I'm on a Solaris 2.7 system.
In addition to the other good advice, make sure that SIG_CHLD is not
being ignored for these children. If it is then waitpid will still
block but it will return -1 and set errno ($!) to ECHILD.
--
Rick Delaney
rick.delaney@rogers.com
------------------------------
Date: Mon, 07 Jul 2003 13:09:20 -0500
From: Bing Du Test <bing-du@tamu.edu>
Subject: Crypt::OpenPGP memory use
Message-Id: <3F09B750.12E72F7D@tamu.edu>
Greetings,
Has anybody had experience with Crypt::OpenPGP, specifically decrypting
large files?
my $plaintext = $pgp->decrypt(
Filename => $encryptedfile,
Passphrase => $pass,
);
In my case, the original file in clear text is about 50M. After
encrypted, it's about 10M and stored in $encryptedfile. It appeared
that decrypting $encrytedfile eat A LOT memory like 300M+, I had to
terminate the decrypting process in fear that too much mem use could
affect the system negatively. Just want to know if I picked the wrong
module in the first place? Or are there any workarounds? Anyway, I
appreciate any help at this point.
Bing
------------------------------
Date: 7 Jul 2003 11:35:31 -0700
From: magelord@t-online.de (Math55)
Subject: Re: Getting the size of files from a list?
Message-Id: <a2b8188a.0307071035.30c2b396@posting.google.com>
inwap@inwap.com (Joe Smith) wrote in message news:<wSqNa.218$603.11936@iad-read.news.verio.net>...
> In article <a2b8188a.0307040214.3ff633c4@posting.google.com>,
> Math55 <magelord@t-online.de> wrote:
> >>
> >> sub to_unit {
> >> my $size = shift;
> >>
> >> if ($size > 1024 * 1024) {
> >> $size = sprintf "%.1fM", $size / (1024*1024);
> >> }
> >> elsif ($size > 1024) {
> >> $size = sprintf "%.1fk", $size / 1024;
> >> }
> >> $size;
> >> }
> >
> >directory has a size near 1mb i get a size like 1020.4 for example.
> >how can i make this a bit more accurate?
>
> It's already too accurate. If you want to avoid having four digits
> before the decimal point, just change the threshold. For example:
>
> :: if ($size > 999.949 * 1024) {
>
> That way the next number after "999.9k" will be "1.0M".
>
> -Joe
hi, how must i change the code so it shows the sum of all
childdirectories from a directory? for example:
/var/log/ksymoops -->3.0MB
/var/log/ -->5.0MB+3.0MB=8.0MB
i tried, but failed:(...THANK YOU FOR YOUR EFFORTS!!!!
------------------------------
Date: Mon, 07 Jul 2003 16:26:51 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Google's newsgroups
Message-Id: <Xns93B1B168DE363sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
How does Google filter newsgroups?
I ask because comp.lang.perl.misc gets between 80 and 200 posts in a
typical day, but google's archive, supposedly "the entire archive of Usenet
discussion groups dating back to 1981", only shows a couple dozen posts per
day. What gives?
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwnlfWPeouIeTNHoEQLD8QCgx7plZ5vBNG22DbqGLn3OjzsAzygAoKIq
KBsdoQY0TvoWdCxOeA/1d+mo
=9cmX
-----END PGP SIGNATURE-----
------------------------------
Date: 07 Jul 2003 21:55:37 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Google's newsgroups
Message-Id: <slrnbgjr2p.tmv.abigail@alexandra.abigail.nl>
Eric J. Roode (REMOVEsdnCAPS@comcast.net) wrote on MMMDXCVII September
MCMXCIII in <URL:news:Xns93B1B168DE363sdn.comcast@206.127.4.25>:
:}
:} How does Google filter newsgroups?
:}
:} I ask because comp.lang.perl.misc gets between 80 and 200 posts in a
:} typical day, but google's archive, supposedly "the entire archive of Usenet
:} discussion groups dating back to 1981", only shows a couple dozen posts per
:} day. What gives?
What makes you think this newsgroup is the place to ask about Google's
policies? Or have you determined that this is the only group which gets
"filtered" by Google?
Abigail
--
($;,$_,$|,$\)=("\@\x7Fy~*kde~box*Zoxf*Bkiaox","."x25,1,"\r");
s/./ /;{vec($_=>1+$"=>8)=ord($/^substr$;=>$"=int rand 24=>1);
print&&select$,,$,,$,,$|/($|+tr/.//c);redo if y/.//};sleep 1;
------------------------------
Date: Tue, 08 Jul 2003 00:04:45 +0200
From: Christophe Baegert <cbaegert-pas-de-spam@europeanservers.net>
Subject: Hanging pipes in CGI Perl
Message-Id: <becqpt$128$1@biggoron.nerim.net>
Hello,
I have a big problem with pipes and Perl.
I made a program A, with these lines
open(PROGB,"|progb") or die "$!";
print PROGB $text;
close PROGB;
And program B is :
open(FILE,">/tmp/file") or die "$!";
wile($line=<STDIN>){
print FILE $line;
}
close FILE;
It runs perfectly when launched in shell, but when I run it in CGI mode, it
hangs, without any error message (it runs without problem if I comment the
part opening and writing to PROGB)
I have this problem in a lot of perl scripts. Every time it occurs, the cgi
scrip stays undefinitely up, I have to kill it manually. I'm looking for
the reason of the problem since a whole year ! I never found the answer. I
really never saw a so strange problem. Please help !!!
I have this problem only on one computer, it works fine on a lot of other
computers. I've already verified /proc/sys/fs/file-nr
My Perl setup (I have the problem with the default install of Perl and this
custom install as well) :
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.20, archname=i686-linux
uname='linux gargantua 2.4.20 #1 smp sam avr 26 00:34:44 cest 2003 i686
unknown '
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O3',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3 19991030 (prerelease)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.1.3'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Jul 6 2003 23:19:05
@INC:
/usr/local/lib/perl5/5.8.0/i686-linux
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
Regards,
Christophe
------------------------------
Date: Mon, 07 Jul 2003 13:58:24 -0400
From: "bd" <bdonlan@bd-home-comp.no-ip.org>
Subject: Re: How differ these lwp queries?
Message-Id: <pan.2003.07.07.17.58.23.747886@bd-home-comp.no-ip.org>
On Mon, 07 Jul 2003 17:44:57 +0000, dkolear wrote:
> Hey;
>
> I've been running through the Perl & LWP OReilly book, generally
> with quite a bit of success. At the moment, I'm trying to automate
> a job query against monster.com. I've verified that I can read in the
> Netscape cookie file correctly by displaying my monster home page
> w/o issues.
>
> The specific job query is:
>
> http://jobsearch.monster.com/jobsearch.asp?brd=1,1862,1863&lid=316&fn=\
> &jt=1&jt=2&jt=3&jt=4&q=UNIX&tm=&cy=US&sq=&col=dltci
>
> If I copy the url into a browser window, it works as I expect.
That's a GET query...
> When I execute the $browser->post command as follows:
>
> my $response = $browser->post(
> 'http://jobsearch.monster.com/jobsearch.asp',
> [ "brd" => "1,1862,1863",
> "lid" => "316",
> "fn" => "",
> "jt" => "1",
> "jt" => "2",
> "jt" => "3",
> "jt" => "4",
> "q" => "UNIX",
> "tm" => "",
> "cy" => "US",
> "sq" => "",
> "col" => "dltci"
> ]);
...but that's a POST query and dosen't put it in the URL. Evidently the
CGI looks at the URL, and can't handle POST semantics. Use a GET query and
it should work.
--
Freenet distribution not available
Resisting temptation is easier when you think you'll probably get
another chance later on.
------------------------------
Date: Mon, 07 Jul 2003 18:38:34 GMT
From: dkoleary@attbi.com
Subject: Re: How differ these lwp queries?
Message-Id: <H6jOa.7490$PI5.3296@news.randori.com>
bd <bdonlan@bd-home-comp.no-ip.org> wrote:
> ...but that's a POST query and dosen't put it in the URL. Evidently the
> CGI looks at the URL, and can't handle POST semantics. Use a GET query and
> it should work.
That was it, thanks. Now, I feel like an idiot; I even knew that.... Duh!
Thanks again.
Doug
--------
Senior UNIX Admin
O'Leary Computer Enterprises
dkoleary@attbi.com (w) 630-904-6098 (h) 630-248-2749
resume: http://home.attbi.com/~dkoleary/resume.html
------------------------------
Date: 7 Jul 2003 19:25:11 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: How do I clone a structure?
Message-Id: <bechen$258$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Greg Bacon:
> In article <u9llva47rc.fsf@wcl-l.bham.ac.uk>,
> Brian McCauley <nobull@mail.com> wrote:
>
>: tadmc@augustmail.com (Tad McClellan) writes:
>:
>: > Your Question is Asked Frequently:
>: >
>: > How do I print out or copy a recursive data structure?
>:
>: Is it just me, or does the word order above seem strange?
>:
>: Surely is should read:
>:
>: "How do I recursively print out or copy a data structure?"
>
> The questions aren't equivalent, but the difference is subtle. Who
> cares how (e.g., recursively or iteratively) you print the data?
>
> Mark me down in the "just you" column. :-)
I don't see where Perl data structures are recursive. A recursive data
structure is for instance a linked list as we know it from C. In Perl
structures are usually not recursive but simply nested iteratively
(hash-ref in an array-ref in a hash etc).
This doesn't mean that the word should be erased from this FAQ (people
might still be able to find this entry with it). But Brian is right
insofar as the recursiveness is often the best way for an
implementation so using it as an adverb as he suggested is technically
more correct.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Mon, 07 Jul 2003 17:03:30 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: LWP, cookies, and adding to request string
Message-Id: <EelOa.39948$Il3.1130945@wagner.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Chris wrote:
> Hello all,
>
> I happened upon this group while searching around for
> information on this topic. Here's the situation:
> I've written a QA test tool for two sites that uses
> LWP and Cookies in Perl. On the first site, I used
> cookie_jar and everything worked just fine as far as
> sessions went. On the second site, however, once a
> user logs in, a unqique session variable (session=) is
> being passed around in the URL wherever you go in the
> members area.
>
> Is there a way to deal with this using LWP and
> cookie_jar?
No, it the CGI on the other end expects the session to be in the GET request parameters, it has to
be there. Unless they're doing something very generic like $session = cookie("name") ||
form("name"); which is both silly, insecure and highly unlikely.
> Another bit of information that may be
> useful: the login form is submitted via Javascript -
> I'm posting to the "resulting" members page via LWP,
> but there could possibly be a middle layer page that
> sets the session variable in the request string.
>
> i.e. Login Page->Js function->(some page I need to
> track down)->resulting members page
>
> In any case, thoughts and suggestions would be greatly
> appreciated.
When scripting stuff like that, one of the best tools I use (aside from a web browser) is a network
sniffing tool, especially one with a good layer 7 analyzer such as ethereal. It makes it very easy
to see *exactly* which variables are being submitted, the method used, any cookies, etc... Stuff
that a javscript function might hide from the browser's end user.
Best of luck.
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/CeAleS99pGMif6wRAnknAJ49spMyC2QAKBJH1mXpJ099SmQALgCfZv8M
+OUkrNdwUQe2cdGIZE0UFQ4=
=41HS
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 07 Jul 2003 18:21:44 GMT
From: "Elena Miele" <0114372622@iol.it>
Subject: microphone input
Message-Id: <YSiOa.153825$Ny5.4368879@twister2.libero.it>
sorry if the question is dumb,
but I cannot find a way to interact - via Perl - with the soundcard input,
to record audio from the microphone.
There is some module out there that can help me here???
thanks!
Alessandro Magni
------------------------------
Date: 07 Jul 2003 20:40:56 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: my first japh
Message-Id: <slrnbgjmmo.tmv.abigail@alexandra.abigail.nl>
Bryan Castillo (rook_5150@yahoo.com) wrote on MMMDXCVII September
MCMXCIII in <URL:news:1bff1830.0307070829.704ed3bf@posting.google.com>:
"" Here is my first attempt at a JAPH. Any pointers on how to shorten
"" it up more and obscure it?
Use a 2pt font.
Abigail
--
perl -wlpe '}$_=$.;{' file # Count the number of lines.
------------------------------
Date: Mon, 7 Jul 2003 13:14:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: naming hash using a variable name.
Message-Id: <slrnbgje4m.2ka.tadmc@magna.augustmail.com>
Garry Short <g4rry_short@zw4llet.com> wrote:
> what does :
> @aliases = @{ $expand_aliases{ $alias } } ;
> do?
Dereferences the array ref contained in $expand_aliases{ $alias }.
It is an application of "Use Rule 1" from:
perldoc perlreftut
> I'm assuming that:
[snip]
> would give the same results as:
[snip]
> Is that right?
use Data::Dumper;
and find out for yourself. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 7 Jul 2003 12:44:21 -0800
From: "tnitzke" <tnitzke@att.net>
Subject: Re: oneliner failed on Win2k with space in path name
Message-Id: <103.6.7.12.44.21.tnitzke@att.net>
Xu Yang wrote:
:
: c:\perl -e "while(<>) {if(/^define/){print $ARGV.#'.$_;}}" c:\usr\*.tt
:
: If I change the "c:\usr" to "c:\program files", it failed with error:
: Can't open c:\program files\*.tt.
: I double quote the path, did not help either.
:
You'll want to quote your arguments when they contain spaces. Try the following.
perl -e "while(<>) {if(/^define/){print $ARGV.#'.$_;}}" "c:\program files\*.tt"
--------------
tnitzke
($_=qq-dfwbh%nxigh%obchvsf%dsfz%voqysfn-)=~tr+%o-za-mn+ a-y'+;eval
------------------------------
Date: Mon, 07 Jul 2003 15:56:36 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: oneliner failed on Win2k with space in path name
Message-Id: <XfkOa.36870$Il3.1087359@wagner.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Xu Yang wrote:
> Hi,
>
> I have an oneliner Perl script (see below) works fine when the path
> name is 8.3 format on Win2K, but failed after it operated on a path
> name contains space:
>
> c:\perl -e "while(<>) {if(/^define/){print $ARGV.#'.$_;}}" c:\usr\*.tt
A shorter version of this is:
perl -ne 'print "$ARGV.#$_" if /^define/'
> If I change the "c:\usr" to "c:\program files", it failed with error:
> Can't open c:\program files\*.tt.
> I double quote the path, did not help either.
I'm not 100% sure how filename globbing works under windows' shell, but try the old 8.3
compatability naming, it might work:
c:\progra~1\*.tt
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/CdB4eS99pGMif6wRAiJ4AJ9A2RRreI7fIl5HjNscETWpUsUOyQCdEdBT
dlH3Nu72i4G3/IYh9YCJ+fc=
=k2QF
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 07 Jul 2003 21:52:11 GMT
From: "Robert" <yyyy@yyy.com>
Subject: Perl Script Problems
Message-Id: <fYlOa.177745$_w.7616965@twister.southeast.rr.com>
Any help on this would be great since its a free script there is no support.
I have a website on a win2k server running MSFP 2002 extensions. The script
should create a html file on the fly but it won't. The script is one of
those post card scripts that sends an e-mail and a link to the card. All
works fine except for the card creation. The e-mail it sends contains a link
but when clicked you get the 404 error.
Anybody PLEASE HELP
Robert
------------------------------
Date: 07 Jul 2003 21:56:48 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Perl Script Problems
Message-Id: <slrnbgjr50.tmv.abigail@alexandra.abigail.nl>
Robert (yyyy@yyy.com) wrote on MMMDXCVII September MCMXCIII in
<URL:news:fYlOa.177745$_w.7616965@twister.southeast.rr.com>:
.. Any help on this would be great since its a free script there is no support.
Perl is free, so by that logic, you're out of luck in this newsgroup.
.. I have a website on a win2k server running MSFP 2002 extensions. The script
.. should create a html file on the fly but it won't. The script is one of
.. those post card scripts that sends an e-mail and a link to the card. All
.. works fine except for the card creation. The e-mail it sends contains a link
.. but when clicked you get the 404 error.
.. Anybody PLEASE HELP
There's a bug on line 17.
Abigail
--
perl -we'$;=$";$;{Just=>another=>Perl=>Hacker=>}=$/;print%;'
------------------------------
Date: 7 Jul 2003 18:06:15 GMT
From: xx087@freenet.carleton.ca (Glenn Jackman)
Subject: Re: references => how not to destroy my data ?
Message-Id: <slrnbgjdkn.d8j.xx087@freenet10.carleton.ca>
Jan <jan_buys@hotmail.com> wrote:
> foreach $juniorMember(@juniorMembers)
> { push( @{$juniorArray}, $juniorMember) ; }
> foreach $seniorMember(@seniorMembers)
> { push( @{$seniorArray}, $seniorMember) ; }
>
> $myrecord = { GROUP => $group,
> JUNIOR => $juniorArray,
> SENIOR => $seniorArray };
Perhaps:
$myrecord = {
GROUP => $group,
JUNIOR => [ @juniorMembers ],
SENIOR => [ @seniorMembers ],
};
--
Glenn Jackman
------------------------------
Date: Mon, 07 Jul 2003 16:15:10 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: references => how not to destroy my data ?
Message-Id: <Xns93B1AF6D94333sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
jan_buys@hotmail.com (Jan) wrote in news:11971c2c.0307070947.5c9a199
@posting.google.com:
>
> foreach $juniorMember(@juniorMembers)
> { push( @{$juniorArray}, $juniorMember) ; }
> foreach $seniorMember(@seniorMembers)
> { push( @{$seniorArray}, $seniorMember) ; }
Why do it one element at a time?
push @$juniorArray, @juniorMembers;
push @$seniorArray, @seniorMembers;
Or better yet:
$juniorArray = \@juniorMembers;
$seniorArray = \@seniorMembers;
--
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwniwGPeouIeTNHoEQJ3cACfXuAMeYIoiUxhYM+B8CJIPcE7KvQAoKhM
dSnzp2Xstumhh6VvwOjJheNr
=t9Jn
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 7 Jul 2003 13:07:02 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: regex and parsing
Message-Id: <slrnbgjdm6.2ka.tadmc@magna.augustmail.com>
Justin Rodino <justin_rodino@yahoo.co.uk> wrote:
> and what i want to do is make variables $user=1233,
Stop wanting that.
Want a hash instead:
$hash{user} = 1233;
See also:
http://www.plover.com/~mjd/perl/varvarname.html
http://www.plover.com/~mjd/perl/varvarname2.html
http://www.plover.com/~mjd/perl/varvarname3.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 7 Jul 2003 08:46:38 -0500
From: Phil R Lawrence <prlawrence@lehigh.edu>
Subject: Re: STDIO problem
Message-Id: <20030707084638.2715b2c0.prlawrence@lehigh.edu>
On 7 Jul 2003 10:20:22 -0700
jan_buys@hotmail.com (Jan) wrote:
> Thanks for the info. For the moment I will send the outputs to
> STDERR, but I don't really like that (call it a religious thing or
> something...) and try another way later on... the show must go on.
Term::ReadLine provides a function called findConsole which attempts to give you the name of the console on your OS (e.g. 'con', 'Dev:Console', '/dev/tty/, whatever.)
Try opening a new output FileHandle to the console like this:
open MYOUT, '>' . findConsole;
------------------------------
Date: Mon, 07 Jul 2003 18:20:38 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Using semicolon delimited autosplit "perl -aF\;"
Message-Id: <3F09BA34.3EEDEF99@acm.org>
C Marshall wrote:
>
> I haven't had any luck managing to autosplit on the semi colon
> character under AIX when putting my commandline options into a script.
>
> i.e. whilst
>
> echo "1;2;3"| perl -anl -F\; -e 'print "$F[1]"'
> 2
>
> works correctly I cannot reproduce the effects in a script
>
> eg
> echo "1;2;3"| test.pl
> Use of uninitialized value in string at test.pl line 4, <> line 1 (#1)
>
> (W uninitialized) An undefined value was used as if it were
> already defined. It was
> interpreted as a "" or a 0, but maybe it was a mistake. To
> suppress this
> warning assign a defined value to your variables.
>
> where test.pl is:
> #!/usr/bin/perl -awnl -F\;
> use diagnostics;
>
> print "$F[1]";
>
> [snip]
>
> Any idea where I'm going wrong ?
You could always do the split explicitly.
#!/usr/bin/perl -wnl
use diagnostics;
@F = split /;/;
print "$F[1]";
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 07 Jul 2003 16:38:08 -0400
From: Stephen Hurrell <shurrell@tbpl.thunder-bay.on.ca>
Subject: Wanted: Help/Script to truncate mp3 files.
Message-Id: <vgjmjsa9jl141c@corp.supernews.com>
Hello.
I would like to learn how to write a script that would truncate a mp3
file to a given number of seconds of music. This is like what amazon
does for their song samples. I want it for just that reason.
Does anyone know of a script to do this or could give pointers to how to
write such a script? I have done a good amount of googling and CPAN but
nothing has really looked applicable for this task.
Thank You in Advance
Stephen Hurrell
------------------------------
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.
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 5191
***************************************