[19172] in Perl-Users-Digest
Perl-Users Digest, Issue: 1367 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 24 11:05:32 2001
Date: Tue, 24 Jul 2001 08:05:08 -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: <995987108-v10-i1367@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 24 Jul 2001 Volume: 10 Number: 1367
Today's topics:
Change CDE background to nobackdrop within perl (thespid)
Re: creating another file <cpryce@pryce.net>
Database Problem (JR)
Re: encrypt a password <rsherman@ce.gatech.edu>
Filehandle major weirdness in recursive I/O (Andrew Mayo)
Re: manpage styles/templates??? <iltzu@sci.invalid>
migrating to Solaris-2.8 perl <ron@18james.com>
Re: Newbie problem: if(<STDIN> =~ /^[yY]/) control stru <peb@bms.umist.ac.uk>
Newbie problem: if(<STDIN> =~ /^[yY]/) control structur (prabu)
opendir(), glob(): 2 or more dots in file names <rczuba@merkury.wsiz.rzeszow.pl>
Re: scope for recursive sub <jasper@guideguide.com>
Re: scope for recursive sub (Anno Siegel)
Re: scope for recursive sub <skilchen@swissonline.ch>
Re: scope for recursive sub <SPAM_lapenta_jm@yahoo.com>
sizes of strings in Activeperl ? (Jan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Jul 2001 07:29:04 -0700
From: thespid@yahoo.com (thespid)
Subject: Change CDE background to nobackdrop within perl
Message-Id: <891e137c.0107240629.7ce7b264@posting.google.com>
I am trying to change the color of the root window's background on
HP-UX. I can do this with
system (xsetroot -solid red);
The only trouble with this is if the CDE has it's backdrop set with
Style Manager to a setting other than NoBackdrop, this will take
precedence. As the application will be running on multiple
workstations I don't want to change the dt/resources file, which would
work until someone changes the background using style manager, hence
the reason for needing to do this from within perl every time I wish
to change the background to several different colors.
Any help will be greatly appreciated.
Spid
------------------------------
Date: Tue, 24 Jul 2001 09:24:44 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: creating another file
Message-Id: <Wwf77.23701$B7.3891907@ruti.visi.com>
"Garry" <garry_short@hotmail.com> wrote in message
news:bdcefd33.0107240241.5c4ed5e1@posting.google.com...
> "Devon Perez" <hoss@chungk.com> wrote in message
news:<aaJ67.32492$k33.2811249@typhoon.kc.rr.com>...
> Not 100% sure, but I don't think > will create a file that doesn't
> exist. I *am* 100% sure, however, that >> will.
>
I'm 100% sure that you should review the open function.
Try perldoc -f open
------------------------------
Date: 24 Jul 2001 08:00:08 -0700
From: tommyumuc@aol.com (JR)
Subject: Database Problem
Message-Id: <319333f5.0107240700.59d86abb@posting.google.com>
Please help! I'm trying to create a small database that takes data
from an intranet form and then updates to a .dat file. The .dat file
takes in all of the fields properly, except for the field from
'textarea' of the form.
Here is the segment of the form that doesn't get submitted properly to
the .dat file (on the same line).
<tr>
<td>
<b>Type of Change:</b>
</td>
<td>
<textarea name = "typeChange" rows = "5" cols =
"58" wrap = "on" >$tempHold
</textarea>
</td>
</tr>
Then I pass it to my CGI script...
my $typeChange = $q->param('typeChange');
But when it gets written to the .dat file, it is written on a newline
(which ruins the whole program).
Here is the example from the .dat file ('add stuff here' represents
dummy data from the textarea section of the form)
01!Alabama!Maps!1!2!3!4!5!6!add stuff here
!07/24/2001!07/24/2001!07/24/2001!07/24/2001!N/A!07/24/2001!07/24/2001!MEMO
#this line is separated into two lines (I don't know what the square
symbol is)
02!Alaska!Maps!1!2!3!4!5!6!7!8!9!10!11!12!13!14!15 #this line is okay
I've tried to chomp and chop $typeChange, which didn't work.
I also tried to set $typeChange to another variable and chopping and
chomping that variable, but that didn't work either (as I guess in
hindsight it shouldn't).
Below is the entire program:
#!/usr/local/bin/perl5 -w
use Fcntl qw(:flock);
use CGI qw(:all);
use CGI qw(:all escape);
use CGI::Carp qw(fatalsToBrowser);
use strict;
my $q = new CGI;
my ( @sdData, $sdData, $stateCode, $stateName, $stateType,
$primeContact,
$primePhone,$primeEmail, $altContact, $altPhone, $altEmail,
$typeChange,
$dateContact, $indexShip, $parentRequest, $parentShip,
@dataFields,
$listShip, $subReceive, $tigerUpdate, $memo, $stripR,
$accessLevel,
@sdDataModified, @tempArray, $tempHold );
sub get_lock {
open(SEM, ">semaphore.sem") || die "Cannot open: $!";
flock(SEM, LOCK_EX) || die "Lock failed: $!";
}
sub release_lock {
close(SEM);
}
sub readdata {
open (SD, "sdData.dat") || die "Cannot open: $! ";
my (@DATA) = <SD>;
@DATA = sort { ($a) cmp ($b) } @DATA;
chomp @DATA;
close (SD);
return (@DATA);
}
sub writedata {
my (@DATA) = @_;
@DATA = sort { ($a) cmp ($b) } @DATA;
open (SD, ">sdData.dat") || die "Cannot open: $! ";
foreach (@DATA) {
print SD "$_\n";
}
chomp @DATA;
close (SD);
}
print header;
#data fields
my $stateCode = $q->param('stateCode'); #hidden field
my $stateName = $q->param('stateName'); #hidden field
my $stateType = $q->param('stateType'); #hidden field
my $primeContact = $q->param('primeContact');
my $primePhone = $q->param('primePhone');
my $primeEmail = $q->param('primeEmail');
my $altContact = $q->param('altContact');
my $altPhone = $q->param('altPhone');
my $altEmail = $q->param('altEmail');
my $typeChange = $q->param('typeChange');
my $dateContact = $q->param('dateContact');
my $indexShip = $q->param('indexShip');
my $parentRequest = $q->param('parentRequest');
my $parentShip = $q->param('parentShip');
my $listShip = $q->param('listShip'); #hidden field
my $subReceive = $q->param('subReceive');
my $tigerUpdate = $q->param('tigerUpdate');
my $memo = $q->param('memo');
$tempHold = $typeChange;
print "$tempHold"; print "<br />";
$tempHold =~ s/\n//;
print "$tempHold<br />";
#hidden elements 0-2 and 14 need to be pushed into database
@dataFields = param; #gather all fields into @dataFields
chomp @dataFields; #remove any newline characters
get_lock();
@sdData=readdata();
chomp @sdData;
@sdData=grep(! /$dataFields[0]!$dataFields[1]/, @sdData);
#foreach (@sdData) {
# next if ( $_ =~ /$dataFields[0]!$dataFields[1]/ );
# push (@sdDataModified, "$_");
#}
#chomp @sdDataModified;
#@sdData = @sdDataModified;
chomp @sdData;
push(@sdData, "$dataFields[0]!$dataFields[1]!$dataFields[2]!$primeContact!$primePhone!$primeEmail!$altContact!$altPhone!$altEmail!$tempHold!$dateContact!$indexShip!$parentRequest!$parentShip!$dataFields[14]!$subReceive!$tigerUpdate!MEMO");
chomp @sdData;
writedata(@sdData);
release_lock();
print "<br />";
print "<html>\n";
print<<START_OF_HTML;
<body bgcolor = '#ffffcc' text = 'black' link = 'blue'>
<head>
</head>
<style type = 'text/css'>
<!--
h1 {color: darkblue; }
.color_change {font-family: #000066; background-color:
#CCCC99; }
.color_change2 {font-family: #000066; background-color:
beige; }
.user_access {font-family: #000066; background-color:
#fffaf0; }
-->
</style>
<body>
<br />
<br />
<table class = 'color_change' align = 'center' width = '65%'
cell padding = '0' cell spacing = '0' border = '2'>
<tr align = 'center'>
<td>
<br />
<h4>The following updates have been made:</h4>
</td>
</tr>
</table>
<br />
<br />
<table class = 'color_change' align = 'center' width = '70%'
cell padding = '0' cell spacing = '0' border = '5'>
<tr>
<td>
<b>Primary Contact:</b>
</td>
<td>
$primeContact
</td>
</tr>
<tr>
<td>
<b>Primary Phone:</b>
</td>
<td>
$primePhone
</td>
</tr>
<tr>
<td>
<b>Primary E-Mail:</b>
</td>
<td>
$primeEmail
</td>
</tr>
<tr>
<td>
<b>Alternate Contact:</b>
</td>
<td>
$altContact
</td>
</tr>
<tr>
<td>
<b>Alternate Phone:</b>
</td>
<td>
$altPhone
</td>
</tr>
<tr>
<td>
<b>Alternate E-Mail:</b>
</td>
<td>
$altEmail
</td>
</tr>
<tr>
<td>
<b>Type of Change:</b>
</td>
<td>
<textarea name = 'NO_VALUE' rows = '10' cols =
'58' wrap = 'on'>$typeChange
</textarea>
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Contacted:</b>
</td>
<td valign = 'lower'>
$dateContact
<br />
<br />
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Index Map(s) Shipped:</b>
</td>
<td>
$indexShip
<br />
<br />
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Parent Map(s) Requested:</b>
</td>
<td>
$parentRequest
<br />
<br />
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Parent Map(s) Shipped:</b>
</td>
<td>
$parentShip
<br />
<br />
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Listing Shipped:</b>
</td>
<td>
$listShip
<br />
<br />
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Submission Received:</b>
</td>
<td>
$subReceive
<br />
<br />
</td>
</tr>
<tr align = 'left' valign = 'upper'>
<td>
<b>Tiger Updated:</b>
</td>
<td>
$tigerUpdate
<br />
<br />
</td>
</tr>
<tr>
<td>
<b>Memo:</b>
</td>
<td>
<textarea name = "NO_VALUE" rows = "10" cols = "58"
wrap = "on">$memo
</textarea>
</td>
</tr>
</table>
<br />
<br />
<form action =
'http://eclipse.geo.census.gov/~jroland/scgi/sdRedirectType.cgi'
method = 'get'>
<center>
<input type = 'submit' value = '<<Return to State
Selection Screen'>
</center>
</form>
<br />
</body>
START_OF_HTML
print "</html>";
I would appreciate any ideas or help! Thanks!
------------------------------
Date: Tue, 24 Jul 2001 09:41:16 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: encrypt a password
Message-Id: <3B5CFC6C.6A41A1AF@ce.gatech.edu>
Patrick Flaherty wrote:
>
> Hello,
>
> ActiveState Perl on W2000.
>
> What do people recommend for encrypting a password to be put into code that
> makes use of Net::FTP?
>
> CPAN tells me of 15 modules (or are they packages?) that correspond to .*crypt.*
> However what I think I need is, obviously, something that encrypts the password
> _outside_ of Perl that I can then put into the code where it will be decrypted.
> I'm not going to worry yet about what form of the password travels over the wire
> during the ftp transaction. I just don't want the plaintext of my password
> sitting in my Perl source.
>
> pat
if your script can decrypt it, then anyone reading the source will be
able to as well...you may want to compile the script or lock down that
account so it can only do what you intend it to do. as far as the
over-the-wire issue, look at Net::SFTP.
-rob
------------------------------
Date: 24 Jul 2001 07:16:27 -0700
From: ajmayo@my-deja.com (Andrew Mayo)
Subject: Filehandle major weirdness in recursive I/O
Message-Id: <2b20cd9f.0107240616.379c5d8b@posting.google.com>
I have absolutely no mental model for the following weird behaviour,
can anyone help?.
Running Perl 5.6.0 on Win2k. The following test program demonstrates a
canonical case of recursive include processing. It takes two data
files.
File include.txt contains the following lines
line 1
include
line 2
line 3
and file include1.txt contains the following lines
inc 1
inc 2
inc 3
inc 4
The perl program below reads include.txt and when it hits the line
'include', reads include1.txt by recursively invoking the read
routine, then resumes reading include.txt. Thus, the output will be
line 1
inc 1
inc 2
inc 3
inc 4
line 2
line 3
and here is the program
printit("include.txt");
sub printit
{
my $fh;
open $fh,$_[0];
while (<$fh>)
{
if (m/include/)
{
printit("include1.txt");
}
print $_;
}
close $fh;
}
So what am I confused about?. Well, depending on the complexity of the
actual program (this is a vastly simplified 'canonical case'), perl
sometimes gets upset about using $fh and produces spurious error
messages (seems to depend on perl version #, and I wanted to use this
code against different perl versions)
The error messages indicate that I/O was being attempted on an
uninitialised file handle.
Changing the line
my $fh;
to read
my $fh="";
cured the error messages but NOW.... when the inner file is read, and
the routine printit returns to its caller, we get EOF immediately on
the outer file read loop and so the remaining lines in the file
include.txt are not printed.
I am confused about this because $fh is a locally-scoped variable and
should therefore be preserved on the stack frame of printit. And
indeed it does seem to be, unless it is initialised. But in theory,
initialising $fh in the inner stack frame cannot possibly alter the
outer stack frame copy.
Can anyone explain what is going on here, or is this a bug?. Or is $fh
acting like an object reference so that the inner copy is really
pointing to the same object as the outer copy?. But if that was so,
how come using it in the inner routine WITHOUT initialising doesn't
cause a problem?. Somehow in that case, the currency of the
outer-level file read is not altered by the recursive call, which
isn't consistent with that theory, because we just partied all over
$fh by using it in the inner call.
Perhaps I am doing things stupidly. If so, what is the preferred
method for handling recursive file I/O, which is required for
processing includes in the input text stream?. I've searched the FAQs
without obvious success.
And there is more weirdness yet. If I print $fh after the open it
prints GLOB(0xnnnnn) where nnnnn is a hex address. And this number is
different for the inner and outer calls, as you would expect. But if I
assign $fh="xyz" before the open, then after the open, $fh still
prints as "xyz" but the while(<$fh>) loop does read correctly (albeit
that we get the problem referred to earlier when we return from the
loop to the caller). How is this possible?. It is as if perl is
binding <$fh> earlier in time to the assignment.
However if you assign to $fh in the body of the loop, this DOES
terminate the loop. This is certainly what I would expect but I can't
reconcile this with the other behaviours noted above.
If $fh contains the string "xyz" how can it simultaneously act as a
file handle?. And yet, somehow, it does. These are deep waters........
Can anyone shed some light?
------------------------------
Date: 24 Jul 2001 13:52:56 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: manpage styles/templates???
Message-Id: <995982701.7433@itz.pp.sci.fi>
In article <066nltov73ko1mbaudu2orsr365v83merk@4ax.com>, MMX166+2.1G HD wrote:
>On Sun, 22 Jul 2001 18:22:27 -0700, in comp.lang.perl.misc Jeff Zucker
><jeff@vpservices.com> wrote:
>>
>>This is a somewhat recursive answer, but pod2html has its own pod so
>>this will tell you how to use it:
>>
>> perldoc pod2html
>
>yes I know the usage. but I can't find the pod file.(for
>NEWS:NNTPClient) What shall I do? write one myself?
In that case, you're better off starting with:
perldoc perldoc
Actually, the specific answer you're looking for is
perldoc -l News::NNTPClient
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Tue, 24 Jul 2001 14:47:32 GMT
From: Ronald Florence <ron@18james.com>
Subject: migrating to Solaris-2.8 perl
Message-Id: <uen15uxu2j.fsf@rosie.18james.com>
After upgrading from Solaris-2.6 to Solaris-2.8, I migrated our perl
scripts to the perl-5.005 supplied with Solaris by changing
/usr/perl5/site_perl to point to our site_perl. This worked fine. But
the CPAN and perl Makefiles no longer work. When I tried the CPAN
supplied with Solaris-2.8, I was able to retrieve a module, but the
build/install failed because it did not find our gcc.
Can someone suggest how I can reconfigure the Solaris-2.8 perl so that
CPAN and the Makefiles in packages will work with our configuration,
including gcc-2.95.3? Thanks,
--
Ronald Florence http://members.home.net/18james
------------------------------
Date: Tue, 24 Jul 2001 15:35:18 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Newbie problem: if(<STDIN> =~ /^[yY]/) control structure returns true if i type y-How
Message-Id: <3B5D87A6.7C934A36@bms.umist.ac.uk>
prabu wrote:
> Hello Geeks,
Not a good way to start a question if you want some help is it?
> I'm a perl newbie.I'm using llama book to learn.In the perl regular
> expressions unit i learnt that "^" is a negation operator.--pg.79 in
> 2nd edition
> Then in pg 85 i foud the above control structure
> " if (<STDIN>=~ /[^yY]/) "
> returns true as return value if i type anything starting with y or Y.
re-read pages 84 and 85 and you'll find that the '^' character outside
of the square brackets anchors the pattern to the beginning of the
string.
HTH
Paul
------------------------------
Date: 24 Jul 2001 07:12:37 -0700
From: prabuanand@excite.com (prabu)
Subject: Newbie problem: if(<STDIN> =~ /^[yY]/) control structure returns true if i type y-How
Message-Id: <9fa34cc5.0107240612.3eaab073@posting.google.com>
Hello Geeks,
I'm a perl newbie.I'm using llama book to learn.In the perl regular
expressions unit i learnt that "^" is a negation operator.--pg.79 in
2nd edition
Then in pg 85 i foud the above control structure
" if (<STDIN>=~ /[^yY]/) "
returns true as return value if i type anything starting with y or Y.
From my earlier understanding "^" means negation operator.So how come
looking(seraching) for a non yY character in my <STDIN> returns true
if i type yY.
from my understanding this should be otherway...
Can some one pls.explain on this issue.I belive my understanding is
wrong somewhere.Pls. help to correct me.
------------------------------
Date: Tue, 24 Jul 2001 15:37:19 +0200
From: "onet" <rczuba@merkury.wsiz.rzeszow.pl>
Subject: opendir(), glob(): 2 or more dots in file names
Message-Id: <9jjtl2$ng3$1@news.onet.pl>
Can you help me I want to know why opendir, or glob don't read file names
with 2 or more dots.
If we have a list of files in direcotry e.g. "sys:directory"
fi.le1.txt
file2.txt
and call script in perl
opendir(handle,"sys:directory");
@files=readdir(handle);
print("@files");
we will get a list like that:
file2.txt
only one file where is the other ???
I get the same error when I use glob.
Where is the problem please can you help me.
------------------------------
Date: Tue, 24 Jul 2001 14:42:58 +0100
From: Jasper McCrea <jasper@guideguide.com>
Subject: Re: scope for recursive sub
Message-Id: <3B5D7B62.B5209383@guideguide.com>
Jason LaPenta wrote:
>
> I tried, my, local,our.. none of them worked.. This everything is a
> global is a major pain for someone who like encapsulation! What I want
> is to call my subroutien from itself and have the data from the new call
> be independant from the previous call. Does this make sense?
This doesn't really make sense. If you call a subroutine from itself
with no parameters (like you do below), and 'have the data from the new
call be independant from the previous call', there is no way that the
sub will not just do exactly the same each time.
>
> sub recursion {
>
> $data = $index++;
> print $data."\n"
> if ( $index < 3 ){
> recursion();
> }
> print $data;
>
> }
This is not what you state above. I believe that you want index as a
global, and data as a local. Ahh, I understand. By data, in the first
paragraph, you meant $data!
try the above with the first line of the sub being
my $data = $index++;
(and put a ';' after the first print statement, of course)
Jasper
and turn on use strict;, and declare $index with my() !!.
>
> $index = 0;
> recursion();
>
> # desired output
> 0
> 1
> 2
> 2
> 1
> 0
>
> Akira Yamanita wrote:
> >
> > Jason LaPenta wrote:
> > >
> > > I have a recursive sub. and I want a local var that is not global, so
> > > each call in the recursion has it's own copy. How do I do this. I've
> > > tried delcaring it local.
> >
> > Use my instead of local.
--
split//,'019617511192'.
'17011111610114101114'.
'21011141011840799901'.
'17101174';
foreach(0..
$#_){$_[$_
++]^=$_[$_
--]^=$_[$_
]^=$_[++ $_]if!($_%
2)}$g.=$_ ,chr($g)=~
/(\w)/&&($o.=$1and
$g='')foreach@_;
print"$o\n"
------------------------------
Date: 24 Jul 2001 14:02:18 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: scope for recursive sub
Message-Id: <9jjv5a$46o$1@mamenchi.zrz.TU-Berlin.DE>
According to Jason LaPenta <SPAM_lapenta_jm@yahoo.com>:
> I tried, my, local,our.. none of them worked.. This everything is a
Both "my" and "local" are likely candidates ("our" isn't), and both
do what you want. "my" is preferred over "local" when you have
a choice. What exactly did you try?
> global is a major pain for someone who like encapsulation! What I want
> is to call my subroutien from itself and have the data from the new call
> be independant from the previous call. Does this make sense?
>
> sub recursion {
>
> $data = $index++;
> print $data."\n"
This is better written as 'print "$data\n";'
> if ( $index < 3 ){
> recursion();
> }
> print $data;
No linefeed? Printing things with no separator between them can
be confusing. Are you sure you didn't overlook some output?
> }
>
> $index = 0;
> recursion();
>
>
> # desired output
> 0
> 1
> 2
> 2
> 1
> 0
The closest you will get with your code above is
0
1
2
210
You get that when you make $data local to the sub block, preferably
using "my $data = $index++;". Did you try that?
Anno
------------------------------
Date: Tue, 24 Jul 2001 16:06:07 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: scope for recursive sub
Message-Id: <9jjvht$oa0rb$1@ID-13368.news.dfncis.de>
"Jason LaPenta" <SPAM_lapenta_jm@yahoo.com> schrieb im Newsbeitrag
news:3B5D6E01.A60C69DC@yahoo.com...
> I tried, my, local,our.. none of them worked..
both of the following give the desired output:
sub recursion_my {
my $data = $index++;
print "$data\n";
if ( $index < 3 ){
recursion_my();
}
print "$data\n";
}
sub recursion_local {
local $data = $index++;
print "$data\n";
if ( $index < 3 ){
recursion_local();
}
print "$data\n";
}
$index = 0;
recursion_my();
$index = 0;
recursion_local();
> # desired output
> 0
> 1
> 2
> 2
> 1
> 0
>
> someone who like encapsulation!
then don't use global variables:
sub recursion {
my $index = $_[0];
my $data = $index++;
print "$data\n";
if ( $index < 3 ){
recursion($index);
}
print "$data\n";
}
recursion(0);
------------------------------
Date: Tue, 24 Jul 2001 11:05:00 -0400
From: Jason LaPenta <SPAM_lapenta_jm@yahoo.com>
Subject: Re: scope for recursive sub
Message-Id: <3B5D8E9C.D2221C2A@yahoo.com>
Ohhh, Ok.
I think I'm starting to get the picture.. In perl I'm guessing that you
can't just declare a variable as local and be done with it... but you
have to use "my" for each assignment. Right??!!?? Before I was only
using a "my $data" at the top of the subroutien once... then I was doing
"$data = bla" and it wasn't working, ie. data was treated as a global.
Now I put my in front of every assignment and it works. Am I right? or
am I really confused? Maybe I should think of the "my" as a "this" in
c++ ( a nice comfortable structured language, unlike the crazy messy
artistic perl)? I must admit, going for the world of VHDL and c++ to
Perl seems take quite a different approach in thinking.
Thanks
jason
------------------------------
Date: 24 Jul 2001 06:38:10 -0700
From: jan2_b@hotmail.com (Jan)
Subject: sizes of strings in Activeperl ?
Message-Id: <114130f5.0107240538.33e522b0@posting.google.com>
Hello,
Strange one here. I use a perl script (ActivePerl) to do some checks
on our clearcase vobs. At a certain moment, I start loading a string
variable with the output of a command-line which generates a huge
output (4 to 5 meg). Afterwards I split this on \n's to end up with a
huge array, which I start investigating for problems. I do this
several times with the same string and array.
All runs well (a bit slow maybe) but when the script has finished, it
hangs and not only the script but also my machine.
Does anyone know whether activeperl or perl itself has size
limitations for strings or any other clue why everything dies once the
script ends ?
Thanks in advance.
------------------------------
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 1367
***************************************