[18441] in Perl-Users-Digest
Perl-Users Digest, Issue: 609 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 3 00:16:34 2001
Date: Mon, 2 Apr 2001 21:15:51 -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: <986271350-v10-i609@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 2 Apr 2001 Volume: 10 Number: 609
Today's topics:
Installing Packages or Win 98 Installation Problem? <fake@email_address.com>
Re: list all subdirectories..... (Gwyn Judd)
Re: list all subdirectories..... (BUCK NAKED1)
log files in sub routines <artd@speakeasy.net>
matrix multiplication <milliwave@rfengineering.freeserve.co.uk>
Re: matrix multiplication <chrisw+usenet@dynamite.com.au>
Re: matrix multiplication (Eric Bohlman)
Re: matrix multiplication <joe+usenet@sunstarsys.com>
Re: matrix multiplication (Gwyn Judd)
Re: matrix multiplication <gtoomey@usa.net>
Re: Most efficient way to extract unique array elements <goldbb2@earthlink.net>
Re: Most efficient way to extract unique array elements (Abigail)
Re: Most efficient way to extract unique array elements <iltzu@sci.invalid>
Re: Multidimensional Arrays? (Garry Williams)
Re: Multidimensional Arrays? <goldbb2@earthlink.net>
Re: Multiple checkboxes <nap@illx.org>
mv - problem with renaming folder with spacing <wo_ah_ho@yahoo.com>
my and local (The Mosquito ScriptKiddiot)
Re: my and local (Mark Jason Dominus)
Re: my and local (Gwyn Judd)
Need Help on Install PerlScript on Win95 <tt930@netvigator.com>
Re: Need Help on Install PerlScript on Win95 <tmwest@umich.edu>
Re: Need Help on Install PerlScript on Win95 <bowman@montana.com>
Re: Newbie: keep on matching until end of string <johnlin@chttl.com.tw>
Re: Newbies welcome <tccoyle@chorus.net>
Re: Opening a Textfile nobull@mail.com
Perl Database Question <jmwjr@bellsouh.net>
Re: PLEASE HELP (0/1) <dave-c@nwinet.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 1 Apr 2001 00:07:20 -0600
From: "JR" <fake@email_address.com>
Subject: Installing Packages or Win 98 Installation Problem?
Message-Id: <9a6g2g$1ffa$1@news.hal-pc.org>
Installing Packages or Win 98 Installation Problem?
Ok, I've had numerous problems trying to install the DBI or CGI package. At
this point I don't know if I setup Perl correctly or if the problem is
elsewhere.
I am installing perl on my Windows 98 system.
I guess what I need is a VERY basic step-by-step approach to make sure I
have been doing everything corerectly. This is what I've been doing:
I downloaded, Win 95/98 Installer and the
ActivePerl-5.6.0.623-MSWin32-x86-multi-thread.msi. Both from Activestate.
I restated between steps. Now, I double click on the installer, it
automatically starts. Now I double click on the
ActivePerl-5.6.0.623-MSWin32-x86-multi-thread.msi.
This starts the installation process with a "Welcome to the Active Perl
Build 617 Setup Wizard" I click next, then I click install.
Now I have 3 features to install:
1 - Perl - with 2 subfiles, Perl ISAPI, Perl Script
2 - Examples
3 - Documentation
Now, I left click on each and select "Will be installed on local hard drive"
, I then click next, I then keep the two boxes checked that say,
Add Perl to the Path environment variable, and
Create Perl file extension association.
I click next then install. Once complete I restart.
Now, of course this installs Perl on my hard drive with five subdirectories,
Bin, Eg, Html, Lib, site.
I have been renaming Perl to usr, and been adding another folder under bin
titled Perl. This is where I've always put my Perl scripts.
Ok, now, my path is:
C:\>path
PATH=C:\PROGRA~1\ULTRAE~1;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\USR\BI
N
Now, to install packages I click on ppm.pl in the bin directory I get:
PPM interactive shell (2.1) - type 'help' for available commands.
PPM>
I check the query and it gives me a list of packages installed on my system.
NOW, I type search and I don't get a search. It only move down one line:
PPM> search
PPM>
I next try to install CGI or DBI and get the same response:
PPM> install cgi
Install package 'cgi?' (y/N): y
Retrieving package 'cgi'...
Error installing package 'cgi': Could not locate a PPD file for package cgi
PPM>
While,,,,, what do you think,,,,, have I missed any steps?
Can anyone help me out.
I hope so, thanks!
James
------------------------------
Date: Sun, 01 Apr 2001 05:24:37 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: list all subdirectories.....
Message-Id: <slrn9cdese.27e.tjla@thislove.dyndns.org>
I was shocked! How could cam <cam@home.com>
say such a terrible thing:
>I want to be able to list all subdirectories from where a script is running
>eg: /data/members/groups/
This question has been asked several times in the last week. You want
the File::Find module.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Dreams are the answers to the questions that we haven’t yet figured out
how to ask.
-- Fox Mulder from‘"The X-Files"
------------------------------
Date: Sun, 1 Apr 2001 00:27:27 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: list all subdirectories.....
Message-Id: <7389-3AC6CA4F-11@storefull-241.iap.bryant.webtv.net>
> > I want to be able to list all subdirectories
> > from where a script is running eg: /data/members/groups/
> This question has been asked several
> times in the last week. You want the > File::Find module.
Sorry, but I'd mark that answer as "non-responsive". Why not tell the
guy how to glob?
@files = glob "DIR*";
Regards,
--Dennis
------------------------------
Date: Mon, 2 Apr 2001 15:04:26 -0400
From: "Speakeasy" <artd@speakeasy.net>
Subject: log files in sub routines
Message-Id: <a24y6.19373$BC6.5377904@e3500-chi1.usenetserver.com>
I have a script that writes to a log several times in it operations. I
trying to be efficient I decided that I would be better to open the log file
once when the first sub was call, and then check if is open and just write
on subsequent calls.
1>How do I know that a filehandle is created and open?
2>Also is there a better way to complete the same task?
3>What happens when the script end with open files?
4>What the overhead of locks vs. open with exclusive/close
sub logevent(TextToLog) {
use Fcntl ':flock'; # import LOCK_* constants
my ($text) = @_; #only take first scalar
my $date=getnow();
$AUTOFLUSH=1;
if (! defined $fileopned) { #does file handle exist?
open(LOGFILE,">>$LOGFILENAME") || die "Unable to open logfile
<$LOGFILENAME>";
$fileopned=1;
print "OPEN\n";
}
flock(LOGFILE,LOCK_EX);
print(LOGFILE "$date $text\n");
flock(LOGFILE,LOCK_UN);
print "LOG: $date $text\n";
return;
}
------------------------------
Date: Sun, 1 Apr 2001 00:29:00 +0100
From: "Milliwave" <milliwave@rfengineering.freeserve.co.uk>
Subject: matrix multiplication
Message-Id: <9a5p44$9m0$1@news6.svr.pol.co.uk>
I am in the process of working out a technique to determine the reflected
coordinates
from the known coordinates. But the reflection is about the origin, and the
position of the
origin is unknown. Example: Considering a rectangle the origin of the
rectangle is unknown on the
coordinate system.
Well I thought of doing a matrix transformation to find the reflected
coordinates of the "box"
along the a) y-axis, and
b) x -axis
To do the following I need to perform matrix multiplication? Can someone
tell me how
I would go about doing matrix multiplication in perl?
Does anyone have any further ideas on how a reflection can be achieved
independent
of it's origin.
cheers
------------------------------
Date: Tue, 3 Apr 2001 11:22:10 +1000
From: "Chris W" <chrisw+usenet@dynamite.com.au>
Subject: Re: matrix multiplication
Message-Id: <7D9y6.9$N56.193663@news.interact.net.au>
"Gwyn Judd" <tjla@guvfybir.qlaqaf.bet> wrote in message
news:slrn9ci3i6.7ms.tjla@thislove.dyndns.org...
> You should read up on mathematical notation. 'iff' means "if and only if."
Yes, and your point is? My comment stands unaltered.
'A matrix can only represent a rotation if and only if the determinate is
one' does not mean the same as 'all matrices with a determinate of one are
represent a rotation' which is what Anno Siegel is interpreting it to mean.
------------------------------
Date: 3 Apr 2001 01:35:05 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: matrix multiplication
Message-Id: <9ab9c9$qub$2@bob.news.rcn.net>
Chris W <chrisw+usenet@dynamite.com.au> wrote:
> "Gwyn Judd" <tjla@guvfybir.qlaqaf.bet> wrote in message
> news:slrn9ci3i6.7ms.tjla@thislove.dyndns.org...
>> You should read up on mathematical notation. 'iff' means "if and only if."
> Yes, and your point is? My comment stands unaltered.
> 'A matrix can only represent a rotation if and only if the determinate is
> one' does not mean the same as 'all matrices with a determinate of one are
> represent a rotation' which is what Anno Siegel is interpreting it to mean.
Er, yes it does. "A if and only if B" means "if A, then B" *and* "if not
A, then not B." IOW, it means that A is both a necessary and sufficient
condition for B.
------------------------------
Date: 31 Mar 2001 20:51:59 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: matrix multiplication
Message-Id: <m3snjt5qv4.fsf@mumonkan.sunstarsys.com>
Keywords: Lie Groups, SL(2), SO(2), different
"Gregory Toomey" <gtoomey@usa.net> continues to write jeopardy-style:
> Look in the following FAQ for matrix multiplication
> http://www.perldoc.com/perl5.6/pod/perlfaq4.html
>
> BTW, remember that a matrix A can represent a rotation iff det(A)=1.
> Just look up "linear algebra" on google for reflections about a line.
Perfectly worthless.
*plonk*
--
Joe Schaefer "His ignorance covered the whole earth like a blanket, and there
was hardly a hole in it anywhere."
--Mark Twain
------------------------------
Date: Tue, 03 Apr 2001 03:19:41 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: matrix multiplication
Message-Id: <slrn9cigac.9nu.tjla@thislove.dyndns.org>
I was shocked! How could Chris W <chrisw+usenet@dynamite.com.au>
say such a terrible thing:
>"Gwyn Judd" <tjla@guvfybir.qlaqaf.bet> wrote in message
>news:slrn9ci3i6.7ms.tjla@thislove.dyndns.org...
>> You should read up on mathematical notation. 'iff' means "if and only if."
>
>'A matrix can only represent a rotation if and only if the determinate is
>one' does not mean the same as 'all matrices with a determinate of one are
>represent a rotation' which is what Anno Siegel is interpreting it to mean.
Yes it does.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
:firmy: /fer'mee/ n. Syn. {stiffy} (a 3.5-inch floppy disk).
From "The New Hackers Dictionary", version 4.2
------------------------------
Date: Sun, 1 Apr 2001 10:45:56 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: matrix multiplication
Message-Id: <oGux6.6720$45.39922@newsfeeds.bigpond.com>
Look in the following FAQ for matrix multiplication
http://www.perldoc.com/perl5.6/pod/perlfaq4.html
BTW, remember that a matrix A can represent a rotation iff det(A)=1.
Just look up "linear algebra" on google for reflections about a line.
gtoomey
----------------------------------
"Milliwave" <milliwave@rfengineering.freeserve.co.uk> wrote in message
news:9a5p44$9m0$1@news6.svr.pol.co.uk...
> I am in the process of working out a technique to determine the reflected
> coordinates
> from the known coordinates. But the reflection is about the origin, and
the
> position of the
> origin is unknown. Example: Considering a rectangle the origin of the
> rectangle is unknown on the
> coordinate system.
>
> Well I thought of doing a matrix transformation to find the reflected
> coordinates of the "box"
> along the a) y-axis, and
> b) x -axis
>
> To do the following I need to perform matrix multiplication? Can someone
> tell me how
> I would go about doing matrix multiplication in perl?
>
> Does anyone have any further ideas on how a reflection can be achieved
> independent
> of it's origin.
>
> cheers
>
>
>
------------------------------
Date: Sun, 01 Apr 2001 04:52:14 GMT
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Most efficient way to extract unique array elements?
Message-Id: <3AC6B4D7.FD108D2F@earthlink.net>
H. Merijn Brand wrote:
>
> abigail@foad.org (Abigail) wrote in
> <slrn9b43ed.863.abigail@tsathoggua.rlyeh.net>:
>
> >Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMDCCLIV
> >September MCMXCIII in
> ><URL:news:98st2f$pn5$1@mamenchi.zrz.TU-Berlin.DE>:
> >.. According to John Bokma <john@castleamber.co.nz>:
> >..
> >.. [...]
> >..
> >.. > Use a hash. A long example:
> >.. >
> >.. > my %hash;
> >.. > foreach my $item (@array1)
> >.. > {
> >.. > $hash{$item} = 1;
> >.. > }
> >.. >
> >.. > keys %hash now contain the unique elements
> >.. >
> >.. > shorter way:
> >.. >
> >.. > my %hash;
> >.. > @hash{@array1} = (1) x @array1;
> >..
> >.. Still shorter:
> >..
> >.. @hash{ @array1} = ();
> >
> >
> >And as one line:
> >
> > my %hash = map {$_ => 1} @array1;
>
> extending that to not using a named hash:
>
> my @keys = sort keys %{ { map { $_ => 1 } @array1 } };
>
> sort is optional
Which of these is more efficient?
@hash{@array1} = ();
%hash = map {$_ => 1} @array1;
Is there any way to do it on one line without using map?
Of course, the *best* way to do this, is to define a subroutine.
sub unique { my %hash; @hash(@_) = (); keys %hash }
my @result = sort unique @array1;
A method which maintains the order of items is:
sub unique { my %seen; grep { !$seen{$_}++ } @_; }
This method was suggested by Joe Schaefer, though he didn't do it
exactly like this.
If you don't want to be using a named hash, I would point out that the
hash is a my variable within a subroutine.
--
Sometimes the journey *is* its own reward--but not when you're trying to
get to the bathroom in time.
------------------------------
Date: Sun, 1 Apr 2001 11:51:29 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Most efficient way to extract unique array elements?
Message-Id: <slrn9ce5i1.ta0.abigail@tsathoggua.rlyeh.net>
Benjamin Goldberg (goldbb2@earthlink.net) wrote on MMDCCLXX September
MCMXCIII in <URL:news:3AC6B4D7.FD108D2F@earthlink.net>:
__
__ Which of these is more efficient?
__ @hash{@array1} = ();
__ %hash = map {$_ => 1} @array1;
use Benchmark; if you really need to know. Also note that the lines are
not quite equivalent.
__ Is there any way to do it on one line without using map?
All the standard ways of rewriting a map apply.
{last unless @array1; $hash {shift @array1} = 1; redo;}
__ Of course, the *best* way to do this, is to define a subroutine.
"Best" according to which standards?
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 1 Apr 2001 12:20:02 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Most efficient way to extract unique array elements?
Message-Id: <986126878.26090@itz.pp.sci.fi>
In article <3AC6B4D7.FD108D2F@earthlink.net>, Benjamin Goldberg wrote:
>
>Which of these is more efficient?
> @hash{@array1} = ();
> %hash = map {$_ => 1} @array1;
Well, there's only one way to answer that, right?
#!/usr/bin/perl -w
use strict;
use Benchmark;
use vars '@list';
@list = 1 .. 1024;
timethese 1<<(shift || 0),
{ for => 'my %hash; $hash{$_} = undef for @list;',
map => 'my %hash = map +{$_ => undef}, @list;',
slice => 'my %hash; @hash{@list} = ();',
undef => 'my %hash; undef @hash{@list};',
};
__END__
Benchmark: timing 1024 iterations of for, map, slice, undef...
for: 10 wallclock secs ( 9.44 usr + 0.06 sys = 9.50 CPU)
map: 30 wallclock secs (28.37 usr + 0.03 sys = 28.40 CPU)
slice: 8 wallclock secs ( 7.26 usr + 0.00 sys = 7.26 CPU)
undef: 8 wallclock secs ( 7.19 usr + 0.27 sys = 7.46 CPU)
Benchmark: timing 1024 iterations of for, map, slice, undef...
for: 12 wallclock secs (10.79 usr + 0.01 sys = 10.80 CPU)
map: 30 wallclock secs (28.82 usr + 0.00 sys = 28.82 CPU)
slice: 9 wallclock secs ( 7.90 usr + 0.00 sys = 7.90 CPU)
undef: 8 wallclock secs ( 7.54 usr + 0.00 sys = 7.54 CPU)
This is perl, version 5.005_03 built for i386-linux
The difference between "@hash{@list} = ()" and "undef @hash{@list}" is
too small to be statistically significant, but both are noticeably
faster than a for loop, and significantly faster than map.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.
------------------------------
Date: Tue, 03 Apr 2001 03:57:44 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Multidimensional Arrays?
Message-Id: <slrn9ciiho.sak.garry@zfw.zvolve.net>
On Mon, 02 Apr 2001 22:14:52 GMT, Benjamin Goldberg
<goldbb2@earthlink.net> wrote:
> Milliwave wrote:
>>
>> I'm new to Perl, and have been reading about how to create a (n-row by
>> 7 column) array?
>> The book I have only shows me how to access a multidimensional array,
>> but does not inform me how to go about creating one?
>
> As others have said, Perl does not have true multidimensional array, but
> it emulates them with references. That said, don't worry about it. The
> arrays will spring into existance as needed.
>
> For example:
> my @x;
> $x[$i][$j] = 4 foreach my $i (0..6) foreach my $j (0..3);
>
> Magically makes x into a 7x4 array.
Funny, it doesn't compile:
perl -we 'my @x;$x[$i][$j] = 4 foreach my $i (0..6) foreach my $j (0..3);'
syntax error at -e line 1, near "$i ("
Execution of -e aborted due to compilation errors.
> Another way of doing something like this is:
> @$x[$i] = ($a, $b, $c, $d) foreach my $i (0..6);
Do I detect a pattern?
--
Garry Williams
------------------------------
Date: Tue, 03 Apr 2001 04:03:38 GMT
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Multidimensional Arrays?
Message-Id: <3AC94C65.7135798C@earthlink.net>
Garry T. Williams wrote:
>
> [This message has also been posted.]
>
> On Mon, 02 Apr 2001 22:14:52 GMT, Benjamin Goldberg
> <goldbb2@earthlink.net> wrote:
>
> > Milliwave wrote:
> >>
> >> I'm new to Perl, and have been reading about how to create a (n-row
> >> by 7 column) array?
> >> The book I have only shows me how to access a multidimensional
> >> array, but does not inform me how to go about creating one?
> >
> > As others have said, Perl does not have true multidimensional array,
> > but it emulates them with references. That said, don't worry about
> > it. The arrays will spring into existance as needed.
> >
> > For example:
> > my @x;
> > $x[$i][$j] = 4 foreach my $i (0..6) foreach my $j (0..3);
> >
> > Magically makes x into a 7x4 array.
>
> Funny, it doesn't compile:
>
> perl -we 'my @x;$x[$i][$j] = 4 foreach my $i (0..6) foreach my $j (0..3);'
> syntax error at -e line 1, near "$i ("
> Execution of -e aborted due to compilation errors.
Umm, oops?
Well, the error is with my loop code, not with my array code, anyway.
>
> > Another way of doing something like this is:
> > @$x[$i] = ($a, $b, $c, $d) foreach my $i (0..6);
>
> Do I detect a pattern?
Guess so :)
And my next suggestion would have been
$x[$i] = [$a, $b, $c, $d] for my $i (0..6);
Or something like that :)
--
Sometimes the journey *is* its own reward--but not when you're trying to get to the bathroom in time.
------------------------------
Date: Mon, 02 Apr 2001 20:56:18 -0700
From: Nick Pinckernell <nap@illx.org>
Subject: Re: Multiple checkboxes
Message-Id: <3AC949E2.3060405@illx.org>
To get their names use the param() in CGI
use CGI;
$q = new CGI;
print $q->header();
@fields = $q->param();
print @fields;
foreach $value (@fields) {
print $q->param($value);
}
FYI: perldoc CGI
_nick
wayne.keenan wrote:
> I'm pretty sure there's a way to enumerta the form items in CGI.
> if thats not actually the case and I plucked that from the air, if you are
> creating
> the form in the first place, at the expense of space and time, why not
> add a hidden element with the list of names?
>
> John Plaxton wrote:
>
>
>> Hi there,
>>
>> A problem that I can't get my mind around!
>>
>> I have got multiple checkboxes (50+) on a form with names pulled from a
>> datasource which means they could be anything.
>>
>> How can I run through each element when the form is submitted and check if
>> they are checked or not?
>>
>> I am using CGI.
>>
>> I can do this if I know what their name properties
>>
>> foreach $field (@fields) {
>> ${$field} = $q->param($field);
>> }
>>
>> where @fields contains a list of names, but I don't know what the names are
>> going to be.
>>
>> Thanks in advance
>>
>> John
------------------------------
Date: Mon, 2 Apr 2001 09:50:38 -0400
From: "Jason Wong" <wo_ah_ho@yahoo.com>
Subject: mv - problem with renaming folder with spacing
Message-Id: <9aa07j$k4n$1@bcrkh13.ca.nortel.com>
I appeared to have problem with the following statement:
system (mv, "E:/option A", "E:/testing");
and this seems to work fine on other directory without spacing.
Is there alternative that I can use to rename a directory?
Thanks
Jason
------------------------------
Date: 03 Apr 2001 01:44:52 GMT
From: anotherway83@aol.com (The Mosquito ScriptKiddiot)
Subject: my and local
Message-Id: <20010402214452.25017.00003070@ng-md1.aol.com>
hey
can sum1 please explain the difference between the variable declarations 'my'
and 'local'??
im currently reading Programming Perl and it has two such examples :
my $variable1=3;
{my $variable1=5;
#code; }
#outside the curly braces the program sees the value of $variable1 as 3
and for 'local' it has a very similar example
local $variable1=3;
{local $variable1=5;
#code; }
#outside the curly braces the program sees the value of $variable1 as 3
so now how r they different??
of course i read the explanations in the book, but i couldn't understand them
too well...
thanks
peace
The Mosquito ScriptKiddiot
Championing the Cause of Mosquitoes in Technology
------------------------------
Date: Tue, 03 Apr 2001 02:44:42 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: my and local
Message-Id: <3ac93919.3700$6a@news.op.net>
In article <20010402214452.25017.00003070@ng-md1.aol.com>,
The Mosquito ScriptKiddiot <anotherway83@aol.com> wrote:
>hey
>
>can sum1 please explain the difference between the variable declarations 'my'
>and 'local'??
http://perl.plover.com/FAQs/Namespaces.html
explains this in detail.
Hope this helps.
------------------------------
Date: Tue, 03 Apr 2001 03:26:09 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: my and local
Message-Id: <slrn9cigmg.9nu.tjla@thislove.dyndns.org>
I was shocked! How could The Mosquito ScriptKiddiot <anotherway83@aol.com>
say such a terrible thing:
>can sum1 please explain the difference between the variable declarations 'my'
>and 'local'??
Well, the biggest difference is that only my() declares a variable.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Don't tell any big lies today. Small ones can be just as effective.
------------------------------
Date: Mon, 2 Apr 2001 22:37:59 +0800
From: "Tony Tang" <tt930@netvigator.com>
Subject: Need Help on Install PerlScript on Win95
Message-Id: <9aa2p7$42l1@imsp212.netvigator.com>
Hi,
When I tried to install ActivePerl 5.6 (build 623) on Win95, the option to
install PerlScript did not show up. However, the PerlScript option did come
up when I installed the same ActivePerl version on Win2000.
Anyone successfully installed PerlScript on Win95 ?
Any help welcome.
Thanks,
Tony.
------------------------------
Date: Mon, 2 Apr 2001 15:22:36 -0400
From: "Thomas M. Westrick" <tmwest@umich.edu>
Subject: Re: Need Help on Install PerlScript on Win95
Message-Id: <Dj4y6.288$4K6.13811@news.itd.umich.edu>
My guess would be the difference is that IIS is installed on the 2000 box
and not the 95.
-Tom.
"Tony Tang" <tt930@netvigator.com> wrote in message
news:9aa2p7$42l1@imsp212.netvigator.com...
> Hi,
>
> When I tried to install ActivePerl 5.6 (build 623) on Win95, the option to
> install PerlScript did not show up. However, the PerlScript option did
come
> up when I installed the same ActivePerl version on Win2000.
>
> Anyone successfully installed PerlScript on Win95 ?
>
> Any help welcome.
>
> Thanks,
> Tony.
>
>
------------------------------
Date: Mon, 2 Apr 2001 20:59:55 -0600
From: "bowman" <bowman@montana.com>
Subject: Re: Need Help on Install PerlScript on Win95
Message-Id: <4Yay6.2361$f35.6272@newsfeed.slurp.net>
"Thomas M. Westrick" <tmwest@umich.edu> wrote in message
news:Dj4y6.288$4K6.13811@news.itd.umich.edu...
> > Anyone successfully installed PerlScript on Win95 ?
> My guess would be the difference is that IIS is installed on the 2000 box
> and not the 95.
Possible, but ActiveState Python successfully registers its scripting
engine. I can run
>cscript foo.pys ok, while >cscript foo.pls complains about the missing
PerlScript. I too, do not see any option for installing PerlScript on a
Win95 box. Not a showstopper, but the AS docs certainly would have you
believe its an option.
------------------------------
Date: Tue, 3 Apr 2001 10:06:00 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: Newbie: keep on matching until end of string
Message-Id: <9abb34$qu@netnews.hinet.net>
"Rick Delaney" wrote:
> John Lin wrote:
> > if(/START/) { pos = $+[0]; @results = /\G\s*(\w+)/g }
> Another way to do this:
> if(/START/g) { @results = /\G\s*(\w+)/g }
> /g in scalar context prevents pos from being reset so you don't have to
> explicitly set it.
Oh, great. After some experiments, I found I can do without the \G
if(/START/g) { @results = /(\w+)/g }
This is good because you just concentrated on what you want.
And something even better
$_ = 'garbage START trash START garbage BEGIN some interested words';
if(/START/g and /START/g and /BEGIN/g) { @results = /(\w+)/g }
Wow, I learned a lot here. Thank you.
John Lin
------------------------------
Date: Sun, 1 Apr 2001 23:23:13 -0500
From: "Tracy Coyle" <tccoyle@chorus.net>
Subject: Re: Newbies welcome
Message-Id: <9a8ufp$68v$1@news.chorus.net>
Darren wrote in message
<2xVp6.4139$t1.320148@news6-win.server.ntlworld.com>...
>This is to all newbies on this and any other newsgroup.
>
>Do not ever be afraid of asking a question...
From a relative newbie, thanks. I learned programming in Fortran 26 years
ago. Did small programming here and there, knew COBOL and a few others. I
decided in December to get back my skills. Started with C++ IDE....exactly
who was the brain that thought giving programmers access to manipulating
memory directly was a good idea??!! Moved to Java....someone recommended
PHP. I have Apache, MySQL and PHP installed and am building my site.
Registration, login, authentication - not using cookies or the globals are
built and functioning.
(Moving it to a remote site scares the bejebees outa me!) That said, I
have used the documentation (annotated PHP is great) and been able to learn
to build as I go along. Whenever I get stuck, I check here....someone is
asking 'the' question or one close enough to it that responses usually give
me enough to go on.
This newsgroup, like the others crossposted are excellant places to learn
and teach. To those that answer, thank you. To those that post, there are
others just like you out here, to those that lurk and learn, no question is
stupid to the 50 others with the same question...
Tracy
------------------------------
Date: 31 Mar 2001 10:45:06 +0100
From: nobull@mail.com
Subject: Re: Opening a Textfile
Message-Id: <u9r8ze9srh.fsf@wcl-l.bham.ac.uk>
jtjohnston <jtjohnston@courrier.usherb.ca> writes:
> I want to read the first line of a text file.
> $line of course can contain many lines. therefore, how can I just print
> line 0 of $line?
> if (open(MYINIFILE, "$ENV{'WINDIR'}/eslcafe_smtp.txt"))
> {
> open(MYINIFILE, "$ENV{'WINDIR'}/eslcafe_smtp.txt");
> $line=<MYINIFILE>;
> print $line;
That will work just just fine if eslcafe_smtp.txt is a text file.
BTW the 2nd open() is redundant.
I suspect eslcafe_smtp.txt is not a text file, or to be more precise
is not a file containing lines deleimited by the default end-of-line
sequence for the operating system on which the above code is executing.
You should either set $/ or use the split() function.
local($/) = "\cJ"; # Or whatever EOL is used in the file
$line=<MYINIFILE>;
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sat, 31 Mar 2001 17:44:01 -0500
From: "Mike Wilson" <jmwjr@bellsouh.net>
Subject: Perl Database Question
Message-Id: <S4tx6.3835$aD4.240523@news2.atl>
I have data that is being stored in cvs format, with a new file for every
day with the date in
the file extension.
ALMLOG.MMDDYY.
ie. ALMLOG.030101 ALMLOG.030201 ALMLOG.030301
Anybody had any experience with data stored in this way.
I was wondering if anyone knew of a DBI that would allow me to query all the
files,
or if I have to roll my own perl code to search through them.
Any ideas on how to approach would be greatly appreciated.
I have the Perl DBI book, but it only show how to query data stored in one
CSV file.
Thanks Mike
------------------------------
Date: Sun, 1 Apr 2001 00:51:10 -0800
From: "remove the hyphen to reply" <dave-c@nwinet.com>
Subject: Re: PLEASE HELP (0/1)
Message-Id: <GUBx6.116991$lj4.3477237@news6.giganews.com>
I just can't resist :-)
Try
while (<>) { # read any # of unix commands
chomp;
s/ /|/g; # replace all spaces with pipe symbols
system($_&); # execute in a background process
}
This techically meets the requirment you specified :-)
Casey West <crt@highvision.net> wrote in message
news:Pine.OSF.4.21.0103300824090.25301-100000@home.kiski.net...
> On Mar 23 around 5:28pm, Michael Jenneson hammered out this masterpiece:
>
> : I have to get this program working
> : it is supposed to read in any number of unix commands
> : and pipe them together and execute each command in
> : separate processes.
> : i cant get it to run
> : PLEASE HELP
>
> I don't see any program, perhaps you forget to paste it?
>
> --
>
> Casey West
>
------------------------------
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 V10 Issue 609
**************************************