[28907] in Perl-Users-Digest
Perl-Users Digest, Issue: 151 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 19 11:10:11 2007
Date: Mon, 19 Feb 2007 08:09:36 -0800 (PST)
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, 19 Feb 2007 Volume: 11 Number: 151
Today's topics:
array of hashes SrikanthMandava2004@gmail.com
array of hashes SrikanthMandava2004@gmail.com
Re: array of hashes <noreply@gunnar.cc>
Re: array of hashes SrikanthMandava2004@gmail.com
Re: behavior of my print function call <joe@inwap.com>
Re: find lines in a file <jesse_hardy@premierinc.com>
Re: global variables <joe@inwap.com>
Re: global variables <bik.mido@tiscalinet.it>
Re: global variables <tadmc@augustmail.com>
Re: Passing parameters from one Perl script to another <bik.mido@tiscalinet.it>
Re: Passing parameters from one Perl script to another <joe@inwap.com>
Re: Passing parameters from one Perl script to another <edMbj@aes-intl.com>
Regex confusion trashman.horlicks@btinternet.com
Re: Regex confusion <tfeserver@gmail.com>
Re: Regexp for email addresses. <bik.mido@tiscalinet.it>
Re: Regexp for email addresses. <cmic@caramail.com>
Sending commands to a secondary prompt <sanjeeb25@gmail.com>
Re: serialize array of references from $sth->fetchall_a <filippo2991@virgilio.it>
Re: Why isn't variable maintained between subroutines i <bik.mido@tiscalinet.it>
Re: Why isn't variable maintained between subroutines i <joe@inwap.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Feb 2007 06:39:58 -0800
From: SrikanthMandava2004@gmail.com
Subject: array of hashes
Message-Id: <1171895998.597568.301540@l53g2000cwa.googlegroups.com>
I have got multiple hashes in an array with same keys. And I want to
count the total of values with same keys.
hash1
score1 20
score2 10
score3 20
hash2
score1 30
score2 20
score3 30
Please note that i have multiple hashes not two as above shown. I am
looking for out put 'Score1 Total = 50; Score2 Total = 30; Score1
Total = 50; '
I have tried the following loop, ended up with some strange
numbers..........advice please
my $sum = 0;
for my $m (0 .. $#notesw){
for $variable (keys %{$notesw[$m]}) {
print "$variable = ${notesw[$m]{$variable}}\n";
$sum += ${notesw[$m]{$variable}};
print "$sum \n";
}
}
------------------------------
Date: 19 Feb 2007 06:41:30 -0800
From: SrikanthMandava2004@gmail.com
Subject: array of hashes
Message-Id: <1171896090.461218.48770@k78g2000cwa.googlegroups.com>
I have got multiple hashes in an array with same keys. And I want to
count the total of values with same keys.
hash1
score1 20
score2 10
score3 20
hash2
score1 30
score2 20
score3 30
Please note that i have multiple hashes not two as above shown. I am
looking for out put 'Score1 Total = 50; Score2 Total = 30; Score1
Total = 50; ' Looking for the output on the basis of having same key.
I am a perl newbie, have tried the following loop, ended up with some
strange numbers..........advice please
my $sum = 0;
for my $m (0 .. $#notesw){
for $variable (keys %{$notesw[$m]}) {
print "$variable = ${notesw[$m]{$variable}}\n";
$sum += ${notesw[$m]{$variable}};
print "$sum \n";
}
}
------------------------------
Date: Mon, 19 Feb 2007 16:07:19 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: array of hashes
Message-Id: <53tssiF1u3q9eU1@mid.individual.net>
SrikanthMandava2004@gmail.com wrote:
> I have got multiple hashes in an array with same keys. And I want to
> count the total of values with same keys.
>
> hash1
>
> score1 20
> score2 10
> score3 20
>
>
> hash2
>
> score1 30
> score2 20
> score3 30
What does that mean? Does it mean this structure?
my @notesw = (
{
'score1' => 20,
'score2' => 10,
'score3' => 20,
},
{
'score1' => 30,
'score2' => 20,
'score3' => 30,
},
);
> I am looking for out put 'Score1 Total = 50; Score2 Total = 30;
> Score1 Total = 50; '
>
> I have tried the following loop, ended up with some strange
> numbers..........
"Some strange numbers" is a terribly bad description of the actual output.
> advice please
>
> my $sum = 0;
> for my $m (0 .. $#notesw){
> for $variable (keys %{$notesw[$m]}) {
> print "$variable = ${notesw[$m]{$variable}}\n";
> $sum += ${notesw[$m]{$variable}};
> print "$sum \n";
> }
> }
Well, you need 3 sums, not just 1, right?
Maybe something like this is what you want:
my ( $sum1, $sum2, $sum3 );
for my $hashref ( @notesw ) {
$sum1 += $hashref->{'score1'};
$sum2 += $hashref->{'score2'};
$sum3 += $hashref->{'score3'};
}
print "Score1 Total = $sum1\n",
"Score2 Total = $sum2\n",
"Score3 Total = $sum3\n";
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 19 Feb 2007 07:37:50 -0800
From: SrikanthMandava2004@gmail.com
Subject: Re: array of hashes
Message-Id: <1171899470.343386.263460@v33g2000cwv.googlegroups.com>
Thanks for the advice.
On Feb 19, 3:07 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> SrikanthMandava2...@gmail.com wrote:
> > I have got multiple hashes in an array with same keys. And I want to
> > count the total of values with same keys.
>
> > hash1
>
> > score1 20
> > score2 10
> > score3 20
>
> > hash2
>
> > score1 30
> > score2 20
> > score3 30
>
> What does that mean? Does it mean this structure?
>
> my @notesw = (
> {
> 'score1' => 20,
> 'score2' => 10,
> 'score3' => 20,
> },
> {
> 'score1' => 30,
> 'score2' => 20,
> 'score3' => 30,
> },
> );
Yes, I will follow that for my future queries.
> > I am looking for out put 'Score1 Total = 50; Score2 Total = 30;
> > Score1 Total = 50; '
>
> > I have tried the following loop, ended up with some strange
> > numbers..........
>
> "Some strange numbers" is a terribly bad description of the actual output.
>
> > advice please
I had out put in 5 digits like 25323 or something ....
> > my $sum = 0;
> > for my $m (0 .. $#notesw){
> > for $variable (keys %{$notesw[$m]}) {
> > print "$variable = ${notesw[$m]{$variable}}\n";
> > $sum += ${notesw[$m]{$variable}};
> > print "$sum \n";
> > }
> > }
>
> Well, you need 3 sums, not just 1, right?
>
> Maybe something like this is what you want:
>
> my ( $sum1, $sum2, $sum3 );
> for my $hashref ( @notesw ) {
> $sum1 += $hashref->{'score1'};
> $sum2 += $hashref->{'score2'};
> $sum3 += $hashref->{'score3'};
> }
> print "Score1 Total = $sum1\n",
> "Score2 Total = $sum2\n",
> "Score3 Total = $sum3\n";
The above hashes are just examples, however files I am working on have
hash value with spaces eg: 'Total data count' which is creating
'Use of uninitialized value in addition (+)' error. Not sure whether I
still need to use the for loop of 'for my $m (0 .. $#notesw)' with the
logic you provided.
I appreciate the help, thanks.
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 19 Feb 2007 01:12:49 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: behavior of my print function call
Message-Id: <aYqdndx-iZaI90TYnZ2dnUVZ_hKdnZ2d@comcast.com>
Dave Slayton wrote:
> Well, I see that the documentation states the curly braces must be there.
> It doesn't begin to explain why.
You're right. Somewhere else it's documented as needing a simple scalar.
> Also, some of the other things it offers don't seem to work as it suggests, e.g.:
> "(NOTE: If FILEHANDLE is a variable and the next token is a term, it may be
> misinterpreted as an operator unless you interpose a "+" or put parentheses
> around the arguments.)"
>
> As I said, parentheses around $file make it think I'm invoking a subroutine,
The "it may be misinterpreted" refers to the things that are after the
filehandle, not the filehandle itself.
Misinterpreted:
print ($a+$b)/$c; <==> (print($a+$b)) / $c;
print $fh ($a+$b)/$c; <==> (print $fh ($a+$b)) / $c;
Interposing a "+" or putting parentheses around the arguments means:
print +($a+$b)/$c; <==> print (($a+$b)/$c);
print $fh +($a+$b)/$c; <==> print $fh (($a+$b)/$c);
-Joe
------------------------------
Date: 19 Feb 2007 05:58:16 -0800
From: "jesse" <jesse_hardy@premierinc.com>
Subject: Re: find lines in a file
Message-Id: <1171893496.649236.7890@p10g2000cwp.googlegroups.com>
On Feb 16, 1:08 pm, "Paul Lalli" <mri...@gmail.com> wrote:
> On Feb 16, 11:40 am, "jesse" <jesse_ha...@premierinc.com> wrote:
>
> > On Feb 14, 11:17 am, "jesse" <jesse_ha...@premierinc.com> wrote:
> > > On Feb 14, 10:37 am, "Paul Lalli" <mri...@gmail.com> wrote:
> > > > On Feb 14, 10:20 am, "jesse" <jesse_ha...@premierinc.com> wrote:
> > > > > On Feb 6, 3:22 pm, "Paul Lalli" <mri...@gmail.com> wrote:
> > > > > > while (<DATA>) {
> > > > > > if (/Error: (.*)/) {
> > > > > > $count_of{$1}++;
> > > > > > }}
> > > > > Paul, I have a question. The (.*) is supposed to capture everything
> > > > > after thematchright? So if I didn't want to capture everything
> > > > > after thematchcould this be changed some how to just grab the next
> > > > > 35charactersafter thematchorbeforethematch?
> > > > if (/Error: (.{35})/) {
> > I have found that what you have given still isn't quite what I need.
>
> I gave you exactly what you *asked for*. I am not a mind reader. If
> you don't need what you ask for, or if you don't ask for what you
> need, there's really very little I can do about it.
>
> > I have read most of the perldoc on regular expressions but I'm still
> > not sure how to fix it. The log files needless to say are not a fix
> > length or width.
>
> Then why did you ask very specifically for 35 characters after a given
> match?
>
> > Here is a couple of line from one of the log files.
>
> > 00:04:21.867 [12870] <2> get_bprdresp: get_string() failed, I/O error
> > (5), premature end of file encountered
> > 00:04:21.868 [12870] <2> process_request: get_hostinfo failed - status
> > = socket read failed (23)
> > 00:04:21.876 [775] <2> listen_loop: select() interrupted
>
> > What I would like for the script to do is ignore everything up to the
> > <2> and just process the line after that.
>
> I have no idea what you mean by "process the line after that." If you
> want the text that comes after the "<2>", then just get it:
>
> if ($line =~ /<2>\s*(.*)/) {
> my $error = $1;
> #do whatever you want with $error;
>
> }
>
> [snip long complicated code snippet]
>
> You need to work on posting short-but-complete scripts that
> demonstrate *just* the problem at hand, and remove all the other
> cruft. For example:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> while (my $line = <DATA>) {
> if ($line =~ /<2>\s*(.*)/) {
> my $error = $1;
> print "The error is: '$error'\n";
> }}
>
> __DATA__
> 00:04:21.867 [12870] <2> get_bprdresp: get_string() failed, I/O error
> (5), premature end of file encountered
> 00:04:21.868 [12870] <2> process_request: get_hostinfo failed - status
> = socket read failed (23)
> 00:04:21.876 [775] <2> listen_loop: select() interrupted
>
> Output:
> The error is: 'get_bprdresp: get_string() failed, I/O error (5),
> premature end of file encountered'
> The error is: 'process_request: get_hostinfo failed - status = socket
> read failed (23)'
> The error is: 'listen_loop: select() interrupted'
>
> Modifying the above for your own needs is left as an excercise for
> you.
>
> Paul Lalli
Thanks!
------------------------------
Date: Mon, 19 Feb 2007 01:29:15 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: global variables
Message-Id: <bb6dnZ3UJstw8ETYnZ2dnUVZ_uCinZ2d@comcast.com>
worlman385@yahoo.com wrote:
> if I call a perl function 26 times,
> are the variables $decode, $flag global variables?
All variables are global unless explicitly specified otherwise.
> I thought they are local variables like methods in Java, once the
> function returns, $decode , $flag will get destroy.
> But when i look into komodo debugger they are global variables.
>
> How can i use them as local variables like method variables in Java?
To do that in perl is sort of like Java, in that such variables need
to be explicitly declared. The keyword to do this is "my".
my $decode = "";
my $flag = $_[0];
for my $i (1 .. 26) {...};
Do not be mislead by "local" in perl. It refers to a global variable
with a local value. Instead, put "use strict; use warnings;" near the
top of the file to have perl help you make sure all variables are
properly declared.
-Joe
------------------------------
Date: Mon, 19 Feb 2007 11:42:09 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: global variables
Message-Id: <58sit2ticcdtv8moe4l803hne6datbj580@4ax.com>
On Sun, 18 Feb 2007 16:35:41 -0800, worlman385@yahoo.com wrote:
>if I call a perl function 26 times,
>
>are the variables $decode, $flag global variables?
Variables do not change their global or local status according to the
number of times a function is called.
>I thought they are local variables like methods in Java, once the
>function returns, $decode , $flag will get destroy.
I don't know Java, but I doubt that methods are *variables* at all.
>for ( $i = 1; $i <= 26; $i++)
>{
> decode($i);
>}
for my $i (1..26) {
decode($i);
}
or
decode($_) for 1..26;
>sub decode
>{
> $decode = "";
> $flag = $_[0];
sub decode {
my $decode = "";
my $flag = $_[0];
> if ( $flag != undef ) {
> $data_file="brute.txt";
> } else {
> $data_file="encoded.txt";
> $flag = 3;
> }
my $data_file;
if ( defined $flag ) {
# ...
If you didn't need to also set $flag, but actually you don't use it
anymore later on, you could do, more concisely
my $data_file = defined $flag ? 'brute.txt' : 'encoded.txt';
> open(DAT, $data_file) || die("Could not open encoded.txt!");
open my $dat, '<', $data_file
or die "Could not open `$data_file': $!\n"
> @raw=<DAT>;
my @raw=<$dat>;
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 19 Feb 2007 05:53:19 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: global variables
Message-Id: <slrnetj3tf.5oq.tadmc@tadmc30.august.net>
worlman385@yahoo.com <worlman385@yahoo.com> wrote:
> I thought they are local variables like methods in Java, once the
> function returns, $decode , $flag will get destroy.
"Coping with Scoping":
http://perl.plover.com/FAQs/Namespaces.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Feb 2007 10:37:32 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Passing parameters from one Perl script to another
Message-Id: <9prit2d14m1308iddf6soj2ml5nbh0jnis@4ax.com>
On Sun, 18 Feb 2007 10:15:35 -0800, Ed Jay <edMbj@aes-intl.com> wrote:
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>>
>> system 'perl', 'otherscript.pl', @ARGV;
>>
>Thank you!
It was meant more as an ironic question than a serious one, but... you
welcome!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 19 Feb 2007 01:47:55 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Passing parameters from one Perl script to another
Message-Id: <cY-dnbxGoaHT70TYnZ2dnUVZ_vWtnZ2d@comcast.com>
Ed Jay wrote:
> I apologize in advance for asking what probably has a simple answer that I
> can't seem to find.
>
> Can I pass parameters from one Perl script to another Perl script?
Yes, there are many ways, depending on just which technique you're using
to access or call the other script.
$result = `./other-script.pl $x $y $z`;
system "./other-script.pl $x $y $z" == 0 or die "other-script failed: $?";
our($x,$y,$z) = (1,22,333); do "other-script.pl";
use other-script qw(fee fie foo fum);
Have you determined which method you will be using to invoke the other-script?
-Joe
------------------------------
Date: Mon, 19 Feb 2007 02:10:29 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Passing parameters from one Perl script to another
Message-Id: <0qtit2t7i8rcnc0p0lq3onnjo2p99ksgjc@4ax.com>
Joe Smith scribed:
>Ed Jay wrote:
>> I apologize in advance for asking what probably has a simple answer that I
>> can't seem to find.
>>
>> Can I pass parameters from one Perl script to another Perl script?
>
>Yes, there are many ways, depending on just which technique you're using
>to access or call the other script.
>
> $result = `./other-script.pl $x $y $z`;
> system "./other-script.pl $x $y $z" == 0 or die "other-script failed: $?";
> our($x,$y,$z) = (1,22,333); do "other-script.pl";
> use other-script qw(fee fie foo fum);
>
>Have you determined which method you will be using to invoke the other-script?
>
Thanks, Joe. I'm using redirect. I'm conditionally going from the script to
either another Perl script or one of two HTML pages.
--
Ed Jay (remove 'M' to respond by email)
------------------------------
Date: 19 Feb 2007 07:55:12 -0800
From: trashman.horlicks@btinternet.com
Subject: Regex confusion
Message-Id: <1171900510.704296.242890@k78g2000cwa.googlegroups.com>
Hi everyone,
I'm just starting to use regex to do some pattern matching but the
syntax is a little confusing. I'm using some of
the on-line regex checkers, but they all fail the following test:
regex /\bTest\s*,/i
look for Test, (or test, etc.)
- result: failure
I can't see anything wrong. Can anyone suggest whats amiss?
TIA
Paul
------------------------------
Date: 19 Feb 2007 08:07:26 -0800
From: "tfe" <tfeserver@gmail.com>
Subject: Re: Regex confusion
Message-Id: <1171901246.269402.279240@k78g2000cwa.googlegroups.com>
Hi,
You look to put a "," and you do not need.
Regex looks like that: /regex/ , or !regex! or #regex# , etc...
If you want to match the word "test", you juste have to put /\btest\b/
to match it.
The final option "i" comes after the separation :
/\btest\b/i
--
tfe
http://tfeserver.be
On 19 f=E9v, 16:55, trashman.horli...@btinternet.com wrote:
> Hi everyone,
> I'm just starting to use regex to do some pattern matching but the
> syntax is a little confusing. I'm using some of
> the on-line regex checkers, but they all fail the following test:
>
> regex /\bTest\s*,/i
> look for Test, (or test, etc.)
> - result: failure
>
> I can't see anything wrong. Can anyone suggest whats amiss?
>
> TIA
>
> Paul
------------------------------
Date: Mon, 19 Feb 2007 12:35:26 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Regexp for email addresses.
Message-Id: <4f2jt29du28c8v05s61s2ncsq6h1116l1l@4ax.com>
On Sun, 18 Feb 2007 14:50:31 +0100, "Petr Vileta"
<stoupa@practisoft.cz> wrote:
>> perl -MO=Deparse -wlpe '}{$_=$.}{'
>>
>> What did it tell you?
>>
>This help me to understand. I never used module Deparse and don't know why
It's B::Deparse.
>Thank you for explanation. I'm using Perl many years but for web scripts
>(cgi) not for one line scripts.
Well, one liners are generally "simpler". Except when using witty obfu
or golf(-like) techniques on purpose, that is.
>Human are learning along all life :-)
I wholeheartedly second that. In the meanwhile I also apologize if my
post seemed overly aggressive in some points. I hope to have given you
some tips about how not to be spoon fed in the future.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 19 Feb 2007 04:51:38 -0800
From: "cmic" <cmic@caramail.com>
Subject: Re: Regexp for email addresses.
Message-Id: <1171889498.771714.172630@p10g2000cwp.googlegroups.com>
On 18 f=E9v, 10:45, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> On Sun, 18 Feb 2007 05:49:48 +0100, "Petr Vileta"
>
> <sto...@practisoft.cz> wrote:
> >> perldoc -q one-liners
>
[=2E..]
>
> OTOH in <news:4rabt21v08jnet2lr7png92bhpq1dqlf8a@4ax.com> I suggested
> a cheap recipe to have Perl tell you what's going on, which I'm also
> repeating here:
>
> perl -MO=3DDeparse -wlpe '}{$_=3D$.}{'
Really helpfull. THX
>
> What did it tell you?
>
> >{ }, but not understand what should to do } { . What is meaning by brack=
ets
> >in reverse order?
>
[=2E..]
> The code you supply in -e will go right after chomp(). If it starts
> with an "unmatched" right curly, the latter won't really be unmatched,
> but it will match the left one on the LINE: line. Similarly the
> "unmatched" left one at the end will match the one below the chomp()
> line, creating an empty block. Thus it's a trick to... trick -p into
> doing something it's not really meant to.
I read "perldoc perlrun", but not enough carefully. Next time...
But I couldn't imagine such tricks ! Maybe I'm a naive programmer...
THX Michele
BTW, your signature worth it, too !
--
michel marcon
>
> HTH,
> Michele
> --
> {$_=3Dpack'B8'x25,unpack'A8'x32,$a^=3Dsub{pop^pop}->(map substr
> (($a||=3Djoin'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB=3D'
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=3D~/./g)x2,$_,
> 256),7,249);s/[^\w,]/ /g;$ \=3D/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 19 Feb 2007 04:29:55 -0800
From: "sanjeeb" <sanjeeb25@gmail.com>
Subject: Sending commands to a secondary prompt
Message-Id: <1171888195.608970.51520@a75g2000cwd.googlegroups.com>
Hello,
Is there any way to send parameters to a secondary command prompt
through perl script.
Suppose there is a command XYZ , which when invoked gives another
secondary prompt. I want to send command to the secondary prompt and
will do the rest of the task after that.
e.g
c:\XYZ <ENTER>
>
Spec-
OS: Win Xp
Build : 5.8
Regards
sanjeeb
------------------------------
Date: 19 Feb 2007 05:20:51 -0800
From: "Filippo" <filippo2991@virgilio.it>
Subject: Re: serialize array of references from $sth->fetchall_arrayref
Message-Id: <1171891251.260101.19170@m58g2000cwm.googlegroups.com>
On 18 Feb, 11:41, Mark Clements <mark.clementsREMOVET...@wanadoo.fr>
wrote:
> Filippo wrote:
> Data::Serializer
>
> which kills two birds with one stone by wrapping serialization
> and encryption into one interface. I have no idea how good it is.
thanks,
this is esactly what I need.
BR,
Filippo
------------------------------
Date: Mon, 19 Feb 2007 09:21:49 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Why isn't variable maintained between subroutines in .pm module?
Message-Id: <tfnit2t02kq8oajdj57pbjfesteoqpsoek@4ax.com>
On Sun, 18 Feb 2007 14:09:39 -0500, Fred <itfred@cdw.com> wrote:
>our $VERSION = '0.01';
>
>use vars qw($host $VERSION @ISA @EXPORT @EXPORT_OK);
Why do you use C<our> in one place, and C<use vars> soon after?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 19 Feb 2007 01:38:38 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Why isn't variable maintained between subroutines in .pm module?
Message-Id: <TYadnVxPg-C87UTYnZ2dnUVZ_rmdnZ2d@comcast.com>
Fred wrote:
> According to the docs, if you define a variable using the
> "use vars" pragma in a perl module, then that variable should
> be available across the entire .pm module.
True.
> use vars qw($host $VERSION @ISA @EXPORT @EXPORT_OK);
This says that $host will be shared unless explicitly overridden.
> sub LoadConfig
> {
> my $host = $config->host();
By using 'my', you have explicitly declared that, for the rest of the
sub, $host will _not_ refer to the global variable with the same name.
Remember, 'my' is exclusive with 'local', 'our', or 'use vars'.
-Joe
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 151
**************************************