Re: perl POE

2004-07-13 Thread Anish Mehta
Ricardo SIGNES wrote:
* Anish Mehta <[EMAIL PROTECTED]> [2004-07-07T04:49:30]
 

Does anyone knows about some good links on PERL POE, how it allows
   

Perl
 

code to make asynchronous, non-blocking I/O calls and handle those I/O
calls on the basis of Event Driven model and Event Queues.
   

poe.perl.org
or, of course, the current front page article on perl.com:
	http://www.perl.com/pub/a/2004/07/02/poeintro.html
 


 

I have read from the above two links mentioned. Now Specifically what 
should i read to know about "How to make asynchronous, non-blocking I/O 
calls and handle those I/O calls on the basis of Event Driven model and 
Event Queues..

Thanks & Regards,
A+


2 Socket questions

2004-07-13 Thread Kelvin Wu
hello,


1, how to use http 1.1 via IO::Socket?

2, if i have a script like this:
&connectserver();
&answerserver();
&closeserver ();

how to do a parallel processing while waiting for server response? use fork?

thanks.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: sub naming conventions

2004-07-13 Thread Randy W. Sims
On 7/13/2004 8:34 PM, perl.org wrote:
There is still a question here - is there any convention difference between
local sub names (in the script) and sub names in modules?  I guess I can
always name my local subs lsWhatever if there is no established convention.
Naw, method names are dem dar thangs wit objects hanging of der side of em.
$obj->method_name()
function_name()
Fully::Qualified::function_name()

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: sort of previously ask, but it really a newie

2004-07-13 Thread Chris Charley

- Original Message - 
From: <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 13, 2004 6:13 PM
Subject: sort of previously ask, but it really a newie


> All,
>
> the data below is my end result from my code below, but I am wondering and
> trying to find a better way to print this from an array that may be
> populated with only 1 element or 39 elements?
> as you can see there is only 18 elements, but I cannot have 39 print lines
> if an array is not populated w/39 elements, right?  So I opted for the
> line highlighted to try and print all elements.  The reasoning is if I
> have a file that has max 40 lines in it (1-40) I will need to print all 40
> and anywhere in between 1-40 so instead of having 39 print lines will the
> print map work with my necessary syntax characters; -w 'barcode= or ' ?
> I could have the E strings be $_   thinking to myself  ; ? )
>
> thank you, !
>
>
> edm01:/usr/local/bin/perld>> perl traverse_array.pl testtapes
> -w 'barcode=E00085 or barcode=E00086 or barcode=E00096 or barcode=E00184'
> -w 'barcode=E00245 or barcode=E00271 or barcode=E00293 or barcode=E00351'
> -w 'barcode=E00524 or barcode=E00584 or barcode=E00585 or barcode=E00586'
> -w 'barcode=E00587 or barcode=E00588 or barcode=E00589 or barcode=E00654'
> -w 'barcode=E00702 or barcode=E00771 or barcode=E00876'
>
>
> Here is my code:
>
>
> #!/usr/local/bin/perl -w
> use strict;
> open (FH,"/usr/local/bin/perld/derektapes") or die "cannot open FH: $!
> \n";
> my @a=();
> my $i=0;
> my $ct=0;
> my $or_string=" or ";
> my $w_param="-w '";
> my $b_param="barcode=";
> while () {
> chomp $_;
> $a[$i]=$_;
> $i++;
> }

You can replace that while loop with:
chomp(my @a = );

> #   if ( $ct == 0 ) {
> #   print map {$_, "\n"} @a;

?

> print $w_param; print $b_param; print $a[0];
> print $or_string;print $b_param; print $a[1];
> print $or_string;print $b_param; print $a[2];
> print $or_string;print $b_param; print "$a[3]'\n";
>
> print $w_param; print $b_param; print $a[4];
> print $or_string; print $b_param; print $a[5];
> print $or_string; print $b_param; print $a[6];
> print $or_string; print $b_param; print "$a[7]'\n";
>
> print $w_param; print $b_param; print $a[8];
> print $or_string; print $b_param; print $a[9];
> print $or_string; print $b_param; print $a[10];
> print $or_string; print $b_param; print "$a[11]'\n";
>
> print $w_param; print $b_param; print $a[12];
> print $or_string; print $b_param; print $a[13];
> print $or_string; print $b_param; print $a[14];
> print $or_string; print $b_param; print "$a[15]'\n";
>
> print $w_param; print $b_param; print $a[16];
> print $or_string; print $b_param; print $a[17];
> print $or_string; print $b_param; print "$a[18]'\n"
>

Instead of using multiple lines that do the same thing, you might want to
try the code below.

while (@a) {
my @output = ();
print "-w ";
for (1..4) {
   push @output, "barcode=" . shift @a;
   last unless @a;
}
print join(" or ", @output), "\n";
}

Chris



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: sub naming conventions

2004-07-13 Thread perl.org
On Tue, 13 Jul 2004 19:17:06 -0500, Wiggins d'Anconia wrote
> 
> Which particular style you happen to choose is less important, than 
> being consistent with it all the way through your programming. 

Good because according to that perldoc I am following about 10% of convention
(though it is pretty consistant), and I would more prefer to be able to read
my own code than worry that someone else would only be able to read code
styled according to Larry.

There is still a question here - is there any convention difference between
local sub names (in the script) and sub names in modules?  I guess I can
always name my local subs lsWhatever if there is no established convention.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: printing 10 scalers/elements

2004-07-13 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

: : "Charles K. Clarkson" <[EMAIL PROTECTED]> wrote
:
: All,
:
: Could you please explain line by line what this code
: is doing below from Charles?

Sorry it took so long. I must have missed this one.


: : use strict;
: : use warnings;
: :
: : use Tie::File;
: : use Array::Dissect qw( reform );

Array::Dissect is a module that provides
a function named reform(). It is used to change
single dimesioned arrays into two dimensional
arrays.

For your report, a two dimensional array
would be far easier to print than a single
dimensioned array.

An example:

use Array::Dissect qw( reform );

my @foo = ( 1 .. 40 );

printf '%02d ' x 40, @foo;

print "\n\n\nThe reformed array:\n";

foreach my $report_line ( reform( 5, @foo ) ) {
printf '%02d ' x 5, @$report_line;
print "\n";
}

__END__

: : tie my @content, 'Tie::File', 'eject 0,0,0 '
: : or die qw(Cannot open "eject 0,0,0 ": $!);

This (hopefully) ties your file to an array.
Anything done to the array will be done to the
underlying file.

 'eject 0,0,0 ' is a mistake. I misunderstood
what you were opening. It should be this. Assuming
$ejectapes holds the filename you are reading.

NOTE: don't change the array values. It *will*
change the values in the file itself.

tie my @content, 'Tie::File', $ejectapes
or die qw(Cannot open "$ejectapes": $!);


BTW, why are your ejecting apes? And where
do they go after you eject them?


: : my $last_index = @content > 40 ? 39 : $#content;

Since you want to limit the array size to 40,
and since you didn't specify whether there might
be less than 40 lines in the file, this statement
limits the last index of the tied array (@content).


: : print join( ' ', @$_ ), "\n"
: : foreach reform( 8, @content[ 0 .. $last_index ] );

This is a shortcut for:

foreach $row ( reform( 8, @content[ 0 .. $last_index ] ) ) {
print join( ' ', @$row ), "\n";
}

A two dimensional array in perl is an Array of
Array References. In this case $row is a reference
to each line of the reformed array. @$row is the
array and we print that array with the print
statement.


: I think I understand most of it but just to make
: sure. All I want to do is set up a maximum 40
: element array with each element as an E string.
: From there only print 5 elements per line then
: "\n" then elements 6-10... etc.  This would be
: 5 lines of 8 never more, always less

Er, no, that would be 8 lines of 5, not 5 lines
of 8. You originally asked for 5 lines of 8. If
that is what you want change the last line above
to this.

print join( ' ', @$_ ), "\n"
foreach reform( 5, @content[ 0 .. $last_index ] );


: This cannot be that hard,  but since I am new to
: the code it is hard.  KSH is much easier, but I
: want to learn PERL !  :)


Perl or perl -- never PERL. :)


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


PS  The ape comments were a small joke. Or as
Pocahontas might say a Minnehaha. If you don't
have a sense of humor you might want to killfile
my future posts. It only gets worse from here. :)







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: sub naming conventions

2004-07-13 Thread Wiggins d'Anconia
perl.org wrote:
On Tue, 13 Jul 2004 18:57:57 -0500, James Edward Gray II wrote
perldoc perlstyle

Thanks.  I had done perldoc perl | find /i "nam" but didn't see anything that
looked relevant.  The people that maintain Perl apparently have a very
different mindset than I do...
Which particular style you happen to choose is less important, than 
being consistent with it all the way through your programming.  Check 
out CPAN and you will see a varied (and wonderful) sample of very 
different styles, of many things, naming conventions, argument passing, 
error handling, etc.  But the best modules on CPAN all exhibit one 
trait, they are consistent wrt their own interface.

Just my $.02...
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: sub naming conventions

2004-07-13 Thread perl.org
On Tue, 13 Jul 2004 18:57:57 -0500, James Edward Gray II wrote
> 
> perldoc perlstyle

Thanks.  I had done perldoc perl | find /i "nam" but didn't see anything that
looked relevant.  The people that maintain Perl apparently have a very
different mindset than I do...

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: sub naming conventions

2004-07-13 Thread James Edward Gray II
On Jul 13, 2004, at 6:52 PM, perl.org wrote:
Is there an established, documented best practice for naming 
subroutines in
Perl?  does it differ whether the subroutine is in a script or a 
module (I
would like it to be clear in my scripts whether I am expecting 
something local
or packaged).  I have seen at least:

some_function()
This one is typical Perl style.  Some of use find it easier to read 
than those Java-ish variants you showed.

Check out:
perldoc perlstyle
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



sub naming conventions

2004-07-13 Thread perl.org
Is there an established, documented best practice for naming subroutines in
Perl?  does it differ whether the subroutine is in a script or a module (I
would like it to be clear in my scripts whether I am expecting something local
or packaged).  I have seen at least:

some_function()
someFunction()
SomeFunction()

TIA,

   -John

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




cmd prompt = success in perl?

2004-07-13 Thread Trina Espinoza

Does getting a return cmd prompt equate to a successfully run script? My 
perl script runs everything correctly, but when the script finishes I see a 
mix of results. Sometimes it returns to the command prompt, sometimes I get 
a delayed cmd prompt (takes a minute or so to return), and sometimes I get a 
no cmd prompt at all (It seems to hang after it finishes).

Could this be no big deal or  is this indicative of a process that's hanging 
and could this potentially be a problem? Is there anything I could do to 
force it give me the cmd prompt right after the script ends? I have an exit 
command right after it finishes, so I am not sure why I get delay or hang 
sometimes.

--Snippet
print("\n$cmd");
system($cmd);
print "Returning to PERL Script\n";
&fetchMovie($number,$directory,$outputPath);
print "DEBUG PERL SCRIPT END\n";
print "Goes to EXIT AFTER END\n";
exit 0;
Thanks ,
-T
_
MSN 9 Dial-up Internet Access helps fight spam and pop-ups – now 2 months 
FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



sort of previously ask, but it really a newie

2004-07-13 Thread DBSMITH
All, 

the data below is my end result from my code below, but I am wondering and 
trying to find a better way to print this from an array that may be 
populated with only 1 element or 39 elements? 
as you can see there is only 18 elements, but I cannot have 39 print lines 
if an array is not populated w/39 elements, right?  So I opted for the 
line highlighted to try and print all elements.  The reasoning is if I 
have a file that has max 40 lines in it (1-40) I will need to print all 40 
and anywhere in between 1-40 so instead of having 39 print lines will the 
print map work with my necessary syntax characters; -w 'barcode= or ' ?
I could have the E strings be $_   thinking to myself  ; ? )

thank you, !


edm01:/usr/local/bin/perld>> perl traverse_array.pl testtapes
-w 'barcode=E00085 or barcode=E00086 or barcode=E00096 or barcode=E00184'
-w 'barcode=E00245 or barcode=E00271 or barcode=E00293 or barcode=E00351'
-w 'barcode=E00524 or barcode=E00584 or barcode=E00585 or barcode=E00586'
-w 'barcode=E00587 or barcode=E00588 or barcode=E00589 or barcode=E00654'
-w 'barcode=E00702 or barcode=E00771 or barcode=E00876'


Here is my code:


#!/usr/local/bin/perl -w
use strict;
open (FH,"/usr/local/bin/perld/derektapes") or die "cannot open FH: $! 
\n";
my @a=();
my $i=0;
my $ct=0;
my $or_string=" or ";
my $w_param="-w '";
my $b_param="barcode=";
while () {
chomp $_;
$a[$i]=$_;
$i++;
}
#   if ( $ct == 0 ) {
#   print map {$_, "\n"} @a;
print $w_param; print $b_param; print $a[0];
print $or_string;print $b_param; print $a[1];
print $or_string;print $b_param; print $a[2];
print $or_string;print $b_param; print "$a[3]'\n";

print $w_param; print $b_param; print $a[4];
print $or_string; print $b_param; print $a[5];
print $or_string; print $b_param; print $a[6];
print $or_string; print $b_param; print "$a[7]'\n";

print $w_param; print $b_param; print $a[8];
print $or_string; print $b_param; print $a[9];
print $or_string; print $b_param; print $a[10];
print $or_string; print $b_param; print "$a[11]'\n";

print $w_param; print $b_param; print $a[12];
print $or_string; print $b_param; print $a[13];
print $or_string; print $b_param; print $a[14];
print $or_string; print $b_param; print "$a[15]'\n";

print $w_param; print $b_param; print $a[16];
print $or_string; print $b_param; print $a[17];
print $or_string; print $b_param; print "$a[18]'\n"


Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145


RE: Proc::Fork

2004-07-13 Thread Bob Showalter
Bob Showalter wrote:
> You want to have some communication between the
> children and the parents so the child can tell the parent when he's
> ready to receive the next message.

Here's an example using a pipe for the children to signal the parent:

#!/usr/bin/perl

use strict;

use IO::Pipe;
use IO::Handle;
use Proc::Fork;

my $num_children = 3;   # no. of children
my $control = IO::Pipe->new;# control channel

# Spawn off some children
my @child;
for my $num (1 .. $num_children) {
my $data = IO::Pipe->new;   # data channel

child {
$data->reader;
$control->writer;
$control->autoflush(1);

print $control "$num\n";
while (<$data>) {
chomp;
print "Child $num: received [$_]\n";
sleep rand(3) + 1;
print $control "$num\n";
}
exit;
};

# parent
$data->writer;
$data->autoflush(1);
push @child, $data;
next;

}

# send data to children as they become ready
my $n = 1;
$control->reader;
while(<$control>) {
chomp;
my $fh = $child[$_ - 1];
print $fh "Data $n\n";
$n++;
last if $n > 20;
}

# reap the children
close $_ for @child;
1 while wait > 0;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Proc::Fork

2004-07-13 Thread Bob Showalter
Michael Gargiullo wrote:
> I receive an error while running this script.  It goes an gets a list
> of 
> IP addresses that are on the network, then collects SNMP data from
> them. 
> ...
> When the script is run I see this output:
> 
> ...
> Can't locate object method "writer. via package "IO::Pipe::End" at
> ./fork-control-test.pl line 92.
> 00:E0:6F:14:AD:A2
> Can't locate object method "writer" via package "IO::Pipe::End" at
> ./fork-control-test.pl line 92.
> 
> Error Received:  Can't locate object method "writer" via package
> "IO::Pipe::End" at ./fork-control-test.pl line 91,  line 1.
> 
> Line 91 of fork-control-test is
> >  $pipe->writer;
> 
> If the child process is something simple like print $data, it works
> great. 
> As soon as I put something in that requires some processing,
> filehandles, or network traffic, I get these errors. 
> 
> Does anyone see issues?  What does the error actually mean?

The error is saying that $pipe has been reblessed into an IO::Pipe::End,
which will be true if you've already called reader() or writer() on the
IO::Pipe object. I can't see anything obvious in your script that would
cause this however, unless the child { } block is somehow running off past
the end where you have the exit; statement.

Note that you really don't want to just pick children at random to fire off
messages to. You want to have some communication between the children and
the parents so the child can tell the parent when he's ready to receive the
next message. That way you keep all your children busy. This can be done by
using another pipe for the children to write their child number back to or
similar.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Global and Local variables issue

2004-07-13 Thread Gunnar Hjalmarsson
Christopher L Hood wrote:
Ok what I have is 3 variables assigned in the global block using my
then when I try to use those variables later in a subroutine I get
an error. The error is below:
Error during compilation of 
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi:
Variable "$ip" will not stay shared at 
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 141.
Variable "$date" will not stay shared at 
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 142.
Variable "$customer" will not stay shared at 
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 158.

Now it was my understanding that if I used my in the global block,
that I could reference that variable in a subroutine. OH, and
strict is on, and cannot be taken off.
First, you should look up the message in "perldoc perldiag".
Are you possibly running the program under mod_perl? I'm asking
because mod_perl may trigger that warning even without nested
subroutines.
One possible solution is to pass the variables as arguments when
calling the subroutine, instead of referring to them from inside the
sub.
HTH
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread jason corbett
I have seen null values come up, but when I do this same query in SQL Plus (Oracle 
environment BTW), I am getting no null values.

Ed Christian <[EMAIL PROTECTED]> wrote:jason corbett wrote:
> Here is what I am doing. I shortend the sub, using local variables,
> and simplifying the whole thing to just print to screen. I use your
> loop once I collect the records into the @record variable and join
> them with ","... 
> 
> Still to no avail, that menacing warning stays.
> 
> Thanks.
> 
> 
> my $sql=qq( select * from bill where rownum <100
> );

Explicitly name the columns you want to select on. It could end up
saving you a bunch of headaches in the long run. Also, go into the MySQL
CLI and type your command in, just to make sure you're getting back what
you want... I'm willing to bet that you're getting back NULL values in
one or more of your columns, which may be causing problems in the join
statement.

> 
> my $sth=$dbh->prepare($sql);
> 
> $sth->execute();
> 
> my $recordlist;
> my $dayreport =
> "/cygdrive/c/cygwin/my_Perl/basic_script/testfile.txt"; 
> 
> my @record;
> 
> 
> 
> while( @record= $sth->fetchrow_array())
> 
> {
> 
> 

For debugging, try adding in the following lines:

use Data::Dumper;
print "# of columns: " . @record . "\n";
print "[EMAIL PROTECTED]:\n" . Dumper([EMAIL PROTECTED]) . "\n";

You may find that your whole array is, in fact, populated with NULL
values...

> $recordlist=join(",",@record); #This statement is causing the problem
> 
> for ( my $i = 0; $i < $#record; $i++)
> {
> print "$record[$i],";
> }
> 
> print "$record[$#record]\n";
> 
> 
> 
> } exit;
> 
> $dbh->disconnect;



Proc::Fork

2004-07-13 Thread Michael Gargiullo
I receive an error while running this script.  It goes an gets a list of
IP addresses that are on the network, then collects SNMP data from them.

There are 8 modems available.

10.100.254.255
10.100.254.252
10.100.255.252
10.100.253.255
10.100.255.254
10.100.255.253
10.100.255.251
10.100.254.254
10.100.254.253

When the script is run I see this output:

#./fork-control-test.pl
10.100.254.255
10.100.254.252
10.100.255.252
10.100.253.255
10.100.255.254
10.100.255.253
10.100.255.251
10.100.254.254
10.100.254.253
0.0.0.0
#
 00:08:0E:E5:C6:AC
00:E0:6F:21:6F:34
00:E0:6F:38:54:06
Can't locate object method "writer. via package "IO::Pipe::End" at
./fork-control-test.pl line 92.
00:E0:6F:14:AD:A2
Can't locate object method "writer" via package "IO::Pipe::End" at
./fork-control-test.pl line 92.

Error Received:  Can't locate object method "writer" via package
"IO::Pipe::End" at ./fork-control-test.pl line 91,  line 1.

Line 91 of fork-control-test is 
>  $pipe->writer;

If the child process is something simple like print $data, it works great.  
As soon as I put something in that requires some processing, filehandles, or network 
traffic, I get these errors.

Does anyone see issues?  What does the error actually mean?

-Mike



The entire script is below.


 use strict;
 use Proc::Fork;
 use IO::Pipe;
 use Net::SNMP;
 use SNMP;
 my $num_children = 4;# How many children we'll create
 my @children;# Store connections to them
 $SIG{CHLD} = 'IGNORE';   # Don't worry about reaping zombies
 # Spawn off some children
 for my $num (1..$num_children)
 {
 # Create a pipe for parent-child communication
 my $pipe = new IO::Pipe;
   

 # Child simply echoes data it receives, until EOF
 child
 {
 $pipe->reader;
 my $data;
 while ($data = <$pipe>)
 {
 chomp $data;
 my $com='notshown';
 my (%VALUES,@tmp,@macparts,$SESSION);
   

  $SESSION = new SNMP::Session( DestHost   => $data,
Community  => $com,
Version=> 2,
Timeout=> 100,
Retries=> 3,
UseSprintValue => 1) ||
die("Can't connect to modem $data");
  $VALUES{'ip_address'} = $data;
  $VALUES{'sysDescr'}=
$SESSION->get(".1.3.6.1.2.1.1.1.0");
  if(!$VALUES{'sysDescr'}) { return; }
  exit -11 if (! $VALUES{'sysDescr'});
  $VALUES{'mac_address'} =
$SESSION->get(".1.3.6.1.2.1.17.1.1.0");
  $VALUES{'level_up'}=
$SESSION->get(".1.3.6.1.2.1.10.127.1.2.2.1.3.2");
  $VALUES{'level_down'}  =
$SESSION->get(".1.3.6.1.2.1.10.127.1.1.1.1.6.3");
  $VALUES{'sn_ratio'}=
$SESSION->get(".1.3.6.1.2.1.10.127.1.1.4.1.5.3");
  $VALUES{'sw_ver'}  =
$SESSION->get(".1.3.6.1.2.1.69.1.3.5.0");
  $VALUES{'config_file'} =
$SESSION->get(".1.3.6.1.2.1.69.1.4.5.0");
  $VALUES{'firmware_ver'} =
$SESSION->get(".1.3.6.1.2.1.69.1.3.2.0");
  $VALUES{'date'}= `date +%Y-%m-%d\\ %H:%M:%S`;
chomp $VALUES{'date'};
 @macparts=split(/\"/, $VALUES{'mac_address'});
  $VALUES{'mac_address'} = $macparts[1];
  chomp $VALUES{'mac_address'};
  $VALUES{'mac_address'} =~ s/\ /:/g;
  $VALUES{'mac_address'} =~ s/:$//;
   

  my @cf=split(/\"/, $VALUES{'config_file'});
  chomp($cf[1]);
  $VALUES{'config_file'} = $cf[1];
   

  my @fw=split(/\"/, $VALUES{'sw_ver'});
  $VALUES{'sw_ver'} = $fw[1];
   

  if (! $VALUES{'sn_ratio'}) {
  $VALUES{'sn_ratio'} = 0;
  }
  if (! $VALUES{'firmware_ver'}) {
  $VALUES{'firmware_ver'} = 'Undefined';
  }
   

  # Sanitize some vars.
  foreach my $l ('level_up', 'level_down', 'sn_ratio') {
if ($VALUES{$l} !~ m/^[0-9\.\-]+$/){
  @tmp=split(/\ /, $VALUES{$l});
  $VALUES{$l}=$tmp[1];
}
  }
  open(MODEMDATA, ">modemdata/

RE: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread Ed Christian
jason corbett wrote:
> Here is what I am doing. I shortend the sub, using local variables,
> and simplifying the whole thing to just print to screen. I use your
> loop once I collect the records into the @record variable and join
> them with ","...   
> 
> Still to no avail, that menacing warning stays.
> 
> Thanks.
> 
> 
> my $sql=qq( select * from bill where rownum <100
> );

Explicitly name the columns you want to select on. It could end up
saving you a bunch of headaches in the long run. Also, go into the MySQL
CLI and type your command in, just to make sure you're getting back what
you want... I'm willing to bet that you're getting back NULL values in
one or more of your columns, which may be causing problems in the join
statement.

> 
> my $sth=$dbh->prepare($sql);
> 
> $sth->execute();
> 
> my $recordlist;
> my $dayreport =
> "/cygdrive/c/cygwin/my_Perl/basic_script/testfile.txt"; 
> 
> my @record;
> 
> 
> 
>  while( @record= $sth->fetchrow_array())
> 
> {
> 
> 

For debugging, try adding in the following lines:

use Data::Dumper;
print "# of columns: " . @record . "\n";
print "[EMAIL PROTECTED]:\n" . Dumper([EMAIL PROTECTED]) . "\n";

You may find that your whole array is, in fact, populated with NULL
values...

>  $recordlist=join(",",@record); #This statement is causing the problem
> 
> for ( my $i = 0; $i < $#record; $i++)
> {
>   print "$record[$i],";
> }
> 
> print "$record[$#record]\n";
> 
> 
> 
>   }exit;
> 
> $dbh->disconnect;

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread William . Ampeh




$recordlist=join(",",@record); #This statement is causing the problem

Have you tried to see if there are any blank records in @record?

__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: [The Subroutine] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread jason corbett
Use of uninitialized value in concatenation (.) or string at select_c.pl line 70
and error
Use of uninitialized value in join or string at select_c.pl line 65.
 
are whats showing up
[EMAIL PROTECTED] wrote:




What about manually stepping through the array elements?

That is:

for ( my $i = 0; $i < $#record; $i++) {
print "$record[$i],";
}
print "$record[$#record]\n";



__

William Ampeh (x3939)
Federal Reserve Board



Re: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread jason corbett
Here is what I am doing. I shortend the sub, using local variables, and simplifying 
the whole thing to just print to screen. I use your loop once I collect the records 
into the @record variable and join them with ","...
 
Still to no avail, that menacing warning stays.
 
Thanks.
 
 
my $sql=qq( select * from bill where rownum <100
);
 
my $sth=$dbh->prepare($sql);
 
$sth->execute();
 
my $recordlist;
my $dayreport = "/cygdrive/c/cygwin/my_Perl/basic_script/testfile.txt";

my @record;

  

 while( @record= $sth->fetchrow_array())
  
{  


 $recordlist=join(",",@record); #This statement is causing the problem

for ( my $i = 0; $i < $#record; $i++) 
{
  print "$record[$i],";
}

print "$record[$#record]\n";



  }exit;
 
$dbh->disconnect;

[EMAIL PROTECTED] wrote:





What about manually stepping through the array elements?

That is:

for ( my $i = 0; $i < $#record; $i++) {
print "$record[$i],";
}
print "$record[$#record]\n";


__

William Ampeh (x3939)
Federal Reserve Board



Global and Local variables issue

2004-07-13 Thread christopher . l . hood
Ok what I have is 3 variables assigned in the global block using my then
when I try to use those variables later in a subroutine I get an error.
The error is below:
 
Error during compilation of
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi:
Variable "$ip" will not stay shared at
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 141.
Variable "$date" will not stay shared at
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 142.
Variable "$customer" will not stay shared at
/usr/local/rt3/local/html/cgi-bin/aupsearch.cgi line 158.
 
 
Now it was my understanding that if I used my in the global block, that
I could reference that variable in a subroutine. OH, and strict is on,
and cannot be taken off.
 
Any help with this will be  greatly appreciated.
 
 
Actual Code below, some code omitted because of security and for
clarity.
 
.
 
# Get parameters from the html form
my $date = $q->param('date');
my $ip = $q->param('ip');
my $customer = $q->param('customer');
 
### Sub to Print VZD Table ###
sub PrintVZDTable {
my @row;
my $rsltid;
my $rsltdate;
my $rslttime;
my $rsltrecord_type;
my $rsltfullname;
my $rsltframed_ip_address;
my $tableline;
my $rsltuser_name;
my $rsltrecord_time;
my $rsltevent_timestamp;
my $sth;
 
print $ip;
print $date;
 
..
 
}
 
 
Chris Hood  
Investigator Verizon Global Security Operations Center 
Email:  
[EMAIL PROTECTED] 
Desk: 972.399.5900

Verizon Proprietary 

NOTICE - This message and any attached files may contain information
that is confidential and/or subject of legal privilege intended only for
the use by the intended recipient.  If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, be advised that you have received this message in
error and that any dissemination, copying or use of this message or
attachment is strictly forbidden, as is the disclosure of the
information therein.  If you have received this message in error please
notify the sender immediately and delete the message. 
 


Re: [The Subroutine] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread William . Ampeh





What about manually stepping through the array elements?

That is:

for ( my $i = 0; $i < $#record; $i++) {
  print "$record[$i],";
}
print "$record[$#record]\n";


__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: [The Subroutine] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread William . Ampeh




What about manually stepping through the array elements?

That is:

for ( my $i = 0; $i < $#record; $i++) {
  print "$record[$i],";
}
print "$record[$#record]\n";



__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: [The Subroutine] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread jason corbett
I used ---print OUTFILE join(",",@record), "\n";--- that you suggested and still got 
the error.
 
 
sub data_collect {unless (open(OUTFILE,">$fourdayreport")) 
 
 {die open(ERRORLOG, ">>$errorlog") && 
 
   
print ERRORLOG "Sorry file $dayreport couldn't be created\n"; return "Failed";} 
 
 
else{
 while( @record= $sth->fetchrow_array())  

 { 
 print OUTFILE join(",",@record), "\n";  
 
 OUTFILE "$recordlist\n}
 
return "success"; }
 
 
}



[EMAIL PROTECTED] wrote:




sub data_collect {unless (open(OUTFILE,">$fourdayreport"))

{die open(ERRORLOG, ">>$errorlog") &&

print ERRORLOG "Sorry file $dayreport couldn't be created\n"; return
"Failed";}

else{

while( @record = $sth->fetchrow_array() )
{
# no warnings;

#INSERTED :::
#Since you are not doing anything with $recordlist, I will do one of the
following:
print OUTFILE join(",",@record), "\n";

#OR:
for ( my $i = 0; $i < $#record; $i++) {
( $i < $#record ) ? print "$record[$i]," : print "$record[$i]\n";
}

#::INSTEAD OF :
my $recordlist=join(",",@record);

print OUTFILE "$recordlist\n";

}return "success";

}
}

__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: new window on redirect

2004-07-13 Thread Wiggins d Anconia
> 
> Jan Eden wrote:
> > Tim McGeary wrote on 13.07.2004:
> > 
> > 
> >>Wiggins d Anconia wrote: 
> >>
> >Sort of. What I don't understand is why do you have to decide on
> >the server side, post-request that the result will be in a new
> >window? Couldn't the original "portal" page just use targets like
> >normal?
> 
> It's a database driven site and so, unfortunately, it is all
> server side, at least for this purpose.  So are you telling me
> there's no real way in perl to do this?
> >>>
> >>>Right, but again, assuming the page they are linking from is driven
> >>>then set the target at the time of the original display rather than
> >>>during the link through?  Aka the user goes to the site, is
> >>>presented a list of links that are from search results, I am
> >>>assuming they will click one of those links to see a detail
> >>>listing, seeing that detailed listing in a new window is what you
> >>>are after?  Rather than trying to set the new window after the
> >>>click, you set it when the list is presented originally. Perl isn't
> >>>really involved in this because it is running on the server side,
> >>>other than you will need to modify how your original result page
> >>>(the one they click on) is displayed.
> >>
> >>That won't work (just tried it).  I cannot set a target in the DB.
> >>
> > 
> > 
> > Sorry, if I do not get you right, but... can't your script provide a
link list like this:
> > 
> > 
> > Item 1234
> > Item 1235
> > Item 1236
> > Item 1237
> > 
> > 
> > This is what Wiggins meant when writing "modify your original
results page" (as far as I understand him). It has nothing to do with
the database nor with Perl. But it works, opening a new window when the
user clicks on a link.
> > 
> > - Jan
> 
> Actually, I later realized this and indeed am looking into that 
> possibility.  :)  I guess I should have responded as such.  Thank you 
> for the reminder.
> 

Yeh that is what I was getting at, obviously didn't do the best job
explaining :-).  (Tim, since you mentioned it was OSS I assumed you
could manipulate the link providing script.) If *all* else fails you
could always wrap the script call to the DB, with a second 'proxy'
script that calls the original page, parses it, and dynamically adds the
targets, but this is very *icky* compared to just modifying the original
source.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: My (variable) versus Our (variable)! Please explain the necessity for use....

2004-07-13 Thread Gunnar Hjalmarsson
Jason Corbett wrote:
Hello folks. I am very thankful for all the help that I am getting
here. The only thing is when I get some suggestions, I don't
normally get the "whys" along with it. One in particular is use of
"my" to assign variables, versus using "our".
http://perl.plover.com/FAQs/Namespaces.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: use module only if it exists

2004-07-13 Thread Ramon Chavez
I forgot to mention

my $IMAGE_SIZE=eval{require Image::Size};
...
if ($IMAGE_SIZE) {
  my ($x, $y) = Image::Size::imgsize($imagen);  ###Call the function
with the module
 }else{
### More code
### Runs if it's not installed
}


-rm-
- Original Message - 
From: "Ramon Chavez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 13, 2004 1:13 PM
Subject: Re: use module only if it exists


> Hi.
> This may be not a high enlightened answer but has solved me some time
> looking for an answer to a question like yours:
>
>
> my $IMAGE_SIZE=eval{require Image::Size};
> ...
> if ($IMAGE_SIZE) {
>### Some code
>### Runs only if Image::Size is installed
> }else{
>### More code
>### Runs if it's not installed
> }
>
>
> HTH
>
> -rm-
>
>
> - Original Message - 
> From: "perl.org" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 13, 2004 12:39 PM
> Subject: use module only if it exists
>
>
> > I want my code to call some subroutines in a custom module only if that
> module
> > exists on the system.  I can think of at least three techniques to
> determine
> > if the module exists: scan @INC, use UNIVERSAL::can (not sure that would
> > work), or put the code in an eval block.  What is the best solution?  I
> think
> > an eval block sounds right, but I'm not sure.  My guess would look
> something like:
> >
> > eval
> > {
> >   use module;
> >   module::subroutine();
> > };
> >
> > But the use statement of course throws a compiler error, so I think the
> > appropriate thing is to put this code into a string and eval that.  But
> this
> > code is going to get replicated to a large number of files and I want
the
> > shortest syntax possible, or if there is some better way...
> >
> > TIA,
> >
> >-John
> >
> >
> >
> >
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >  
> >
> >
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: [The Subroutine] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread William . Ampeh




sub data_collect {unless (open(OUTFILE,">$fourdayreport"))

{die open(ERRORLOG, ">>$errorlog") &&

print ERRORLOG "Sorry file $dayreport couldn't be created\n"; return
"Failed";}

else{

 while( @record = $sth->fetchrow_array() )
 {
# no warnings;

#INSERTED :::
#Since you are not doing anything with $recordlist, I will do one of the
following:
print OUTFILE join(",",@record), "\n";

#OR:
for ( my $i = 0; $i < $#record; $i++) {
  ( $i < $#record ) ? print "$record[$i]," : print "$record[$i]\n";
}

#::INSTEAD OF :
 my $recordlist=join(",",@record);

 print OUTFILE "$recordlist\n";

   }return "success";

   }
}

__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




My (variable) versus Our (variable)! Please explain the necessity for use....

2004-07-13 Thread jason corbett
Hello folks. I am very thankful for all the help that I am getting here. The only 
thing is when I get some suggestions, I don't normally get the "whys" along with it. 
One in particular is use of "my" to assign variables, versus using "our". Until I can 
get a Perl scripting class to take, I am teaching myself and sometimes these books 
don't delve into the simple things. So who can answer this?
 
Thanks,
JC



Re: use module only if it exists

2004-07-13 Thread Ramon Chavez
Hi.
This may be not a high enlightened answer but has solved me some time
looking for an answer to a question like yours:


my $IMAGE_SIZE=eval{require Image::Size};
...
if ($IMAGE_SIZE) {
   ### Some code
   ### Runs only if Image::Size is installed
}else{
   ### More code
   ### Runs if it's not installed
}


HTH

-rm-


- Original Message - 
From: "perl.org" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 13, 2004 12:39 PM
Subject: use module only if it exists


> I want my code to call some subroutines in a custom module only if that
module
> exists on the system.  I can think of at least three techniques to
determine
> if the module exists: scan @INC, use UNIVERSAL::can (not sure that would
> work), or put the code in an eval block.  What is the best solution?  I
think
> an eval block sounds right, but I'm not sure.  My guess would look
something like:
>
> eval
> {
>   use module;
>   module::subroutine();
> };
>
> But the use statement of course throws a compiler error, so I think the
> appropriate thing is to put this code into a string and eval that.  But
this
> code is going to get replicated to a large number of files and I want the
> shortest syntax possible, or if there is some better way...
>
> TIA,
>
>-John
>
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: creating a table in Microsoft Word

2004-07-13 Thread Tim Johnson


One easy way with Win32::OLE is to create the table while recording a
macro in Word, and then convert the macro to Perl.


-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 13, 2004 10:47 AM
To: [EMAIL PROTECTED]
Subject: Re: creating a table in Microsoft Word

[Tim Johnson] snip-

Take a look at Win32::OLE. It will allow you to start an (invisible) 
instance of Word and control it.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: use module only if it exists

2004-07-13 Thread perl.org
On Tue, 13 Jul 2004 12:59:06 -0500, JupiterHost.Net wrote
> I know of a module that is almost done with that has a function called

Thanks, but unfortunately I'm working on a very restricted system (not being
able to install custom modules on the production platform is actually the
issue I'm facing, so I couldn't install your module there...).


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: use module only if it exists

2004-07-13 Thread Randy W. Sims
perl.org wrote:
I want my code to call some subroutines in a custom module only if that module
exists on the system.  I can think of at least three techniques to determine
if the module exists: scan @INC, use UNIVERSAL::can (not sure that would
work), or put the code in an eval block.  What is the best solution?  I think
an eval block sounds right, but I'm not sure.  My guess would look something like:
eval
{
  use module;
  module::subroutine();
};
But the use statement of course throws a compiler error, so I think the
appropriate thing is to put this code into a string and eval that.  But this
code is going to get replicated to a large number of files and I want the
shortest syntax possible, or if there is some better way...
use constant HAS_CONFIG_PM => (eval "use Config") || !$@;
print "has Config\n" if HAS_CONFIG_PM;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



[The Subroutine] What is "Use of uninitialized JOIN" error?

2004-07-13 Thread jason corbett
Thanks all for the feedback on the WARNING message that I am getting. I know that I 
can turn warning off at that moment of code, but I want to know for my own knowledge 
what is the warning all about. So, here is the entire sub routine. NOTE** I declared 
@records as a global earlier..
 
JC
 
sub data_collect {unless (open(OUTFILE,">$fourdayreport")) 
 
{die open(ERRORLOG, ">>$errorlog") &&
 
print ERRORLOG "Sorry file $dayreport couldn't be created\n"; return "Failed";}  
 
else{
 
 while( @record = $sth->fetchrow_array() )  
 { 
# no warnings;  
 
 my $recordlist=join(",",@record);   
   
 print OUTFILE "$recordlist\n";   
 
   }return "success"; 
   
   } 
}
[EMAIL PROTECTED] wrote:




Where do you populate @record? Such messages occur when populating an
array with contents of a file (if the file contains a bunch of newlines).
So make sure you know what the array is getting populated with by testing.


Also, you want to join before printing, correct? So swap the lines (but
that is not the cause of the warning).

> print OUTFILE "$recordlist\n";
>$recordlist=join(",",@record);

I will try to view the contents of @record with
foreach my $item (@record) {
print " . item: $item\n";
}




__

William Ampeh (x3939)
Federal Reserve Board



Re: use module only if it exists

2004-07-13 Thread JupiterHost.Net

perl.org wrote:
I want my code to call some subroutines in a custom module only if that module
exists on the system.  I can think of at least three techniques to determine
if the module exists: scan @INC, use UNIVERSAL::can (not sure that would
work), or put the code in an eval block.  What is the best solution?  I think
an eval block sounds right, but I'm not sure.  My guess would look something like:
eval
{
  use module;
  module::subroutine();
};
I know of a module that is almost done with that has a function called
gotmodule()
if( gotmodule('Foo::Bar') ) {
  print "Foo::Bar is version $Foo::Bar::VERSION\n";
} else {
  print "You should install Foo::Bar it is pretty nice\n";
}
If you're insterested I can let you know when it is done...
(I'm tracking it for the Author..)
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: creating a table in Microsoft Word

2004-07-13 Thread Jenda Krynicky
From: "gripman7" <[EMAIL PROTECTED]>
> Does anyone know how to access Microsoft Word and create a table?
> 
> Henri
> [EMAIL PROTECTED]

Take a look at Win32::OLE. It will allow you to start an (invisible) 
instance of Word and control it.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




use module only if it exists

2004-07-13 Thread perl.org
I want my code to call some subroutines in a custom module only if that module
exists on the system.  I can think of at least three techniques to determine
if the module exists: scan @INC, use UNIVERSAL::can (not sure that would
work), or put the code in an eval block.  What is the best solution?  I think
an eval block sounds right, but I'm not sure.  My guess would look something like:

eval
{
  use module;
  module::subroutine();
};

But the use statement of course throws a compiler error, so I think the
appropriate thing is to put this code into a string and eval that.  But this
code is going to get replicated to a large number of files and I want the
shortest syntax possible, or if there is some better way...

TIA,

   -John




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: new window on redirect

2004-07-13 Thread Tim McGeary
Jan Eden wrote:
Tim McGeary wrote on 13.07.2004:

Wiggins d Anconia wrote: 
Sort of. What I don't understand is why do you have to decide on
the server side, post-request that the result will be in a new
window? Couldn't the original "portal" page just use targets like
normal?
It's a database driven site and so, unfortunately, it is all
server side, at least for this purpose.  So are you telling me
there's no real way in perl to do this?
Right, but again, assuming the page they are linking from is driven
then set the target at the time of the original display rather than
during the link through?  Aka the user goes to the site, is
presented a list of links that are from search results, I am
assuming they will click one of those links to see a detail
listing, seeing that detailed listing in a new window is what you
are after?  Rather than trying to set the new window after the
click, you set it when the list is presented originally. Perl isn't
really involved in this because it is running on the server side,
other than you will need to modify how your original result page
(the one they click on) is displayed.
That won't work (just tried it).  I cannot set a target in the DB.

Sorry, if I do not get you right, but... can't your script provide a link list like 
this:

Item 1234
Item 1235
Item 1236
Item 1237

This is what Wiggins meant when writing "modify your original results page" (as far as 
I understand him). It has nothing to do with the database nor with Perl. But it works, opening a 
new window when the user clicks on a link.
- Jan
Actually, I later realized this and indeed am looking into that 
possibility.  :)  I guess I should have responded as such.  Thank you 
for the reminder.

Tim
Tim McGeary
Senior Library Systems Specialist
Lehigh University
610-758-4998
[EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: new window on redirect

2004-07-13 Thread Jan Eden
Tim McGeary wrote on 13.07.2004:

>Wiggins d Anconia wrote: 
>
Sort of. What I don't understand is why do you have to decide on
the server side, post-request that the result will be in a new
window? Couldn't the original "portal" page just use targets like
normal?
>>>
>>>It's a database driven site and so, unfortunately, it is all
>>>server side, at least for this purpose.  So are you telling me
>>>there's no real way in perl to do this?
>>
>>Right, but again, assuming the page they are linking from is driven
>>then set the target at the time of the original display rather than
>>during the link through?  Aka the user goes to the site, is
>>presented a list of links that are from search results, I am
>>assuming they will click one of those links to see a detail
>>listing, seeing that detailed listing in a new window is what you
>>are after?  Rather than trying to set the new window after the
>>click, you set it when the list is presented originally. Perl isn't
>>really involved in this because it is running on the server side,
>>other than you will need to modify how your original result page
>>(the one they click on) is displayed.
>
>That won't work (just tried it).  I cannot set a target in the DB.
>

Sorry, if I do not get you right, but... can't your script provide a link list like 
this:


Item 1234
Item 1235
Item 1236
Item 1237


This is what Wiggins meant when writing "modify your original results page" (as far as 
I understand him). It has nothing to do with the database nor with Perl. But it works, 
opening a new window when the user clicks on a link.

- Jan
-- 
Hanlon's Razor: Never attribute to malice that which can be adequately explained by 
stupidity.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Proc::Fork

2004-07-13 Thread Michael Gargiullo
I receive an error while running this script.  It goes an gets a list of
IP addresses that are on the network, then collects SNMP data from them.

There are 8 modems available.

10.100.254.255
10.100.254.252
10.100.255.252
10.100.253.255
10.100.255.254
10.100.255.253
10.100.255.251
10.100.254.254
10.100.254.253

When the script is run I see this output:

#./fork-control-test.pl
10.100.254.255
10.100.254.252
10.100.255.252
10.100.253.255
10.100.255.254
10.100.255.253
10.100.255.251
10.100.254.254
10.100.254.253
0.0.0.0
#
 00:08:0E:E5:C6:AC
00:E0:6F:21:6F:34
00:E0:6F:38:54:06
Can't locate object method "writer. via package "IO::Pipe::End" at
./fork-control-test.pl line 92.
00:E0:6F:14:AD:A2
Can't locate object method "writer" via package "IO::Pipe::End" at
./fork-control-test.pl line 92.

Error Received:  Can't locate object method "writer" via package
"IO::Pipe::End" at ./fork-control-test.pl line 91,  line 1.

Line 91 of fork-control-test is 
>  $pipe->writer;

If the child process is something simple like print $data, it works
great.  
As soon as I put something in that requires some processing,
filehandles, or network traffic, I get these errors.

Does anyone see issues?  What does the error actually mean?

-Mike



The entire script is below.


 use strict;
 use Proc::Fork;
 use IO::Pipe;
 use Net::SNMP;
 use SNMP;
 my $num_children = 4;# How many children we'll create
 my @children;# Store connections to them
 $SIG{CHLD} = 'IGNORE';   # Don't worry about reaping zombies
 # Spawn off some children
 for my $num (1..$num_children)
 {
 # Create a pipe for parent-child communication
 my $pipe = new IO::Pipe;
   

 # Child simply echoes data it receives, until EOF
 child
 {
 $pipe->reader;
 my $data;
 while ($data = <$pipe>)
 {
 chomp $data;
 my $com='notshown';
 my (%VALUES,@tmp,@macparts,$SESSION);
   

  $SESSION = new SNMP::Session( DestHost   => $data,
Community  => $com,
Version=> 2,
Timeout=> 100,
Retries=> 3,
UseSprintValue => 1) ||
die("Can't connect to modem $data");
  $VALUES{'ip_address'} = $data;
  $VALUES{'sysDescr'}=
$SESSION->get(".1.3.6.1.2.1.1.1.0");
  if(!$VALUES{'sysDescr'}) { return; }
  exit -11 if (! $VALUES{'sysDescr'});
  $VALUES{'mac_address'} =
$SESSION->get(".1.3.6.1.2.1.17.1.1.0");
  $VALUES{'level_up'}=
$SESSION->get(".1.3.6.1.2.1.10.127.1.2.2.1.3.2");
  $VALUES{'level_down'}  =
$SESSION->get(".1.3.6.1.2.1.10.127.1.1.1.1.6.3");
  $VALUES{'sn_ratio'}=
$SESSION->get(".1.3.6.1.2.1.10.127.1.1.4.1.5.3");
  $VALUES{'sw_ver'}  =
$SESSION->get(".1.3.6.1.2.1.69.1.3.5.0");
  $VALUES{'config_file'} =
$SESSION->get(".1.3.6.1.2.1.69.1.4.5.0");
  $VALUES{'firmware_ver'} =
$SESSION->get(".1.3.6.1.2.1.69.1.3.2.0");
  $VALUES{'date'}= `date +%Y-%m-%d\\ %H:%M:%S`;
chomp $VALUES{'date'};
 @macparts=split(/\"/, $VALUES{'mac_address'});
  $VALUES{'mac_address'} = $macparts[1];
  chomp $VALUES{'mac_address'};
  $VALUES{'mac_address'} =~ s/\ /:/g;
  $VALUES{'mac_address'} =~ s/:$//;
   

  my @cf=split(/\"/, $VALUES{'config_file'});
  chomp($cf[1]);
  $VALUES{'config_file'} = $cf[1];
   

  my @fw=split(/\"/, $VALUES{'sw_ver'});
  $VALUES{'sw_ver'} = $fw[1];
   

  if (! $VALUES{'sn_ratio'}) {
  $VALUES{'sn_ratio'} = 0;
  }
  if (! $VALUES{'firmware_ver'}) {
  $VALUES{'firmware_ver'} = 'Undefined';
  }
   

  # Sanitize some vars.
  foreach my $l ('level_up', 'level_down', 'sn_ratio') {
if ($VALUES{$l} !~ m/^[0-9\.\-]+$/){
  @tmp=split(/\ /, $VALUES{$l});
  $VALUES{$l}=$tmp[1];
}
  }
  open(MODEMDATA, ">modemdata/$

Re: Regex for numbers and text

2004-07-13 Thread Jeff 'japhy' Pinyan
On Jul 13, Gunnar Hjalmarsson said:

>Jeff 'Japhy' Pinyan wrote:
>
>>   /(-?(?=.?\d)\d*\.?\d*)/
>
>I disagree.
>
>- It has almost as many characters.
>- It's more difficult to read/understand.
>- It's slower (see benchmark below).

Aww, shucks.  Fine.  My attempts have failed.

-- 
Jeff "japhy" Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regex for numbers and text

2004-07-13 Thread Gunnar Hjalmarsson
Randy W. Sims wrote:
Gunnar Hjalmarsson wrote:
use warnings;
use Regexp::Common 'number';
$_ = '.';
/^$RE{num}{real}$/ and print "\"$_\" is a number.\n";
my $x = 1 if $_ < 5;
Outputs:
"." is a number.
"." isn't numeric in numeric lt (<) at ...
Regexp::Common considers an alone decimal point to be a number,
while the Perl compiler does not. Did you know that?  ;-)
Hrm, that's unfortunate :-/
Well, I'll still take this as an argument in favor of using modules
like Regexp::Common.
Why am I not surprised...

BTW, I've posted the following to RT:
[cpan #6940] lone . (decimal) considered a match for $RE{num}{real}
-
 perl -MRegexp::Common=number -e 'print "oops\n" if "." =~
/$RE{num}{real}/'
This was pointed out to me by Gunnar Hjalmarsson in a thread on 
<[EMAIL PROTECTED]> ...
Good. And thanks for giving me credit. :)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Regex for numbers and text

2004-07-13 Thread Gunnar Hjalmarsson
Jeff 'Japhy' Pinyan wrote:
I've seen the response of /-?(?:\d+\.?\d*|\.\d+)/, and while that
does work, it seems too noisy to me.  What we would really like to
be able to say is /-?\d*\.?\d*/, but you should be able to see that
could match "-." and "." and "", which we decided aren't legitimite
numbers.
So use a look-ahead.
  /(-?(?=.?\d)\d*\.?\d*)/
I disagree.
- It has almost as many characters.
- It's more difficult to read/understand.
- It's slower (see benchmark below).
Personally I avoid extended patterns for those reasons, when a
straight forward regex is sufficient.
*That* regex requires some explanation.
Yep.
Who will give it?
Extended patterns are explained in "perldoc perlre".
This is the benchmark I run:
use Benchmark 'cmpthese';
cmpthese -1, {
ext=> sub {'2.3' =~ /-?(?=.?\d)\d*\.?\d*/ and my $x = 1},
normal => sub {'2.3' =~ /-?(?:\d+\.?\d*|\.\d+)/ and my $x = 1}
};
Result:
   Rateext normal
ext186637/s --   -19%
normal 230310/s23% --
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: A simple text or GUI-based menu script

2004-07-13 Thread Mike Flannigan
> Subject: Re: A simple text or GUI-based menu script
> Date: Sat, 10 Jul 2004 07:43:17 -0400
> From: zentara <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
>
> I have very little experience with getting Perl running on Windows.
> But it seems it should run because it's pure perl.  Proc::Killfam is
> part of Tk::ExecuteCommand and requires Proc::Processtable.
>
> The docs for Proc::ProcessTable says that to run on windows, it requires
> the Cygwin environment.
>
> So I guess I would say try to get Proc::ProcessTable installed.

I was unable to find Proc::ProcessTable on ActiveState.
I run Win2000, and I probably won't get this script to run.


Mike Flannigan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Reading a variable file name

2004-07-13 Thread JupiterHost.Net

[EMAIL PROTECTED] wrote:
Greetings,
Hello,
Would someone be kind enough to point me in the right direction to solve this 
problem?
I'll try :)
An application creates XML files in a subdirectory, which I then convert to 
EDI.  That part is now working fine.  My problem is that the application 
creates files during the day, with slightly different names.  For example:

File0001.xml
File0002.xml
File0244.xml
The file names vary based on what part of the application creates them.  
There seems to be no pattern of the number after the alpha characters.  I need to 
read each of these files, and concatenate them into a single EDI file.  The 
only files in the subdirectory need to be processed;  and all of the files in 
the subdirectory need to be processed.

Could someone point me in the right direction?
Not sure about how the filename effects if you want to incude it or not 
 but:

#!/usr/bin/perl
use strict;
use warnings;
use File::Slurp;
for(read_dir('/xml/files')) {
   if($_ =~ m/\.xml$/) {
   my $xml = read_file("/xml/files/$_");
   append_file('/xml/together.edi',$xml);
   }
}
Thanks for your help.
No problem :)
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: MIME coding & flags for sending a .csv or Excel file (Here is the code)

2004-07-13 Thread Randal L. Schwartz
> "Jason" == Jason Corbett <[EMAIL PROTECTED]> writes:

Jason> our ($dbh);  #
Jason> our (@files);  #
Jason> our ($filename); #
Jason> our ($errorlog); #logs all successes and failures of the report
Jason> our ($dirfolder); #where the treatment report is sent prior to emailing
Jason> our (@record);  #holds all records returned from query
Jason> our ($success_var); #flags the script if completion was successful or not
Jason> our ($sql);  #
Jason> our ($sth);  #
Jason> our ($dayreport); #
Jason> our ($process_date); #used in the log file to tell what date and time a file 
complete or failed
Jason> our ($month);  #
Jason> our ($day);  #
Jason> our ($year);  #
Jason> our ($truename); #Time stamps the name of each treatment report AFTER the 
GENERIC name is changed
Jason> our (@times);  #Helps Timestamp the treatment reports each day
Jason> our ($reportlog); #Folder for keeping up with all Treatment reports
Jason> our ($fourdayreport); #the path that leads to the location of the generic 4 day 
report
Jason> our ($recordlist); #allows the for manipulation of data retrieved from query

This script is already unmaintainable for me.

Far too many global variables, and some with names that suggest
related usage, but aren't connected.

Just feedback.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: What is "Use of uninitialized JOIN" error?

2004-07-13 Thread William . Ampeh




Where do you populate @record?  Such messages occur when  populating an
array with contents of a file (if the file contains a bunch of newlines).
So make sure you know what the array is getting populated with by testing.


Also, you want to join before printing, correct?  So swap the lines (but
that is not the cause of the warning).

> print OUTFILE "$recordlist\n";
>$recordlist=join(",",@record);

I will try to view the contents of @record with
foreach my $item (@record) {
  print " . item: $item\n";
}




__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: What is "Use of uninitialized JOIN" error?

2004-07-13 Thread Jackson, Jonah
Hard to tell for certain from that snippet, but I'd say @record is a null value in 
your execution for one reason or another (i.e. there is nothing stored in that array) 
so when it tries to execute the join, there is no list for the second argument to the 
"join" function.

In handling it, you need to decide if that is a legitimate execution (i.e. is it ok 
that @record is empty) or if it is the result of an error in another part of your code.

Jonah Jackson

-Original Message-
From: jason corbett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 13, 2004 10:47 AM
To: perl beginners
Subject: What is "Use of uninitialized JOIN" error?


Can anyone tell me what is happening here?
 
Thanks,
JC
 
Here is the part of the code that the error is pointing to

 print OUTFILE "$recordlist\n"; 
$recordlist=join(",",@record);


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: What is "Use of uninitialized JOIN" error?

2004-07-13 Thread Jeff 'japhy' Pinyan
On Jul 13, jason corbett said:

>Here is the part of the code that the error is pointing to
>
> print OUTFILE "$recordlist\n";
>$recordlist=join(",",@record);

It's not an error, it's a warning.  And you didn't give us the *actual*
text of the warning.  It looks to me like the problem is you're using the
variable before you've given it a value!

  my $recordlist = join ",", @record;
  print OUTFILE "$recordlist\n";

-- 
Jeff "japhy" Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: new window on redirect

2004-07-13 Thread Tim McGeary
Wiggins d Anconia wrote:

Sort of. What I don't understand is why do you have to decide on the
server side, post-request that the result will be in a new window? 
Couldn't the original "portal" page just use targets like normal?
It's a database driven site and so, unfortunately, it is all server 
side, at least for this purpose.  So are you telling me there's no real 
way in perl to do this?
Right, but again, assuming the page they are linking from is driven then
set the target at the time of the original display rather than during
the link through?  Aka the user goes to the site, is presented a list of
links that are from search results, I am assuming they will click one of
those links to see a detail listing, seeing that detailed listing in a
new window is what you are after?  Rather than trying to set the new
window after the click, you set it when the list is presented
originally. Perl isn't really involved in this because it is running on
the server side, other than you will need to modify how your original
result page (the one they click on) is displayed.
That won't work (just tried it).  I cannot set a target in the DB.
[sigh]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: new window on redirect

2004-07-13 Thread Thomas Bätzler
Tim McGeary <[EMAIL PROTECTED]> asked:
> > Sort of. What I don't understand is why do you have to decide on the
> > server side, post-request that the result will be in a new window? 
> > Couldn't the original "portal" page just use targets like normal?
 
> It's a database driven site and so, unfortunately, it is all server
> side, at least for this purpose.  So are you telling me 
> there's no real way in perl to do this?

Actually, there is no real way to do that in any
programming language. It's not a Perl-specific issue.

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




What is "Use of uninitialized JOIN" error?

2004-07-13 Thread jason corbett
Can anyone tell me what is happening here?
 
Thanks,
JC
 
Here is the part of the code that the error is pointing to

 print OUTFILE "$recordlist\n"; 
$recordlist=join(",",@record);



Re: new window on redirect

2004-07-13 Thread Wiggins d Anconia
Please group reply so others can help and be helped.

> Wiggins d Anconia wrote:
> > Please bottom post...
> 
> I hate bottom posting...  but alas...  scroll down.  :)
> 

Yes but it makes it easier to follow (you can always snip so as not to
force a long scroll)

> >>Sorry, I didn't mean to not include everyone on my reply...

You did the last time but not this time, hmph.



> > Sort of. What I don't understand is why do you have to decide on the
> > server side, post-request that the result will be in a new window? 
> > Couldn't the original "portal" page just use targets like normal?
> 
> It's a database driven site and so, unfortunately, it is all server 
> side, at least for this purpose.  So are you telling me there's no real 
> way in perl to do this?
> 

Right, but again, assuming the page they are linking from is driven then
set the target at the time of the original display rather than during
the link through?  Aka the user goes to the site, is presented a list of
links that are from search results, I am assuming they will click one of
those links to see a detail listing, seeing that detailed listing in a
new window is what you are after?  Rather than trying to set the new
window after the click, you set it when the list is presented
originally. Perl isn't really involved in this because it is running on
the server side, other than you will need to modify how your original
result page (the one they click on) is displayed.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: new window on redirect

2004-07-13 Thread Tim McGeary
Wiggins d Anconia wrote:
Please bottom post...
I hate bottom posting...  but alas...  scroll down.  :)
Sorry, I didn't mean to not include everyone on my reply...
The reason I need a new window (and I did actually mean _blank), is 
because this is for a Library portal site which has a limited window 
view.  Our users actually (almost) demand a new window because they 
don't want to have to hit their back button 20 times to get back to 
their customized list of electronic Library resources.


Ah, I love tab capable browsers ;-). (I know it is unreasonable to force
your users to use one.)

And so, if I don't open a new window, then they will complain that they 
cannot see the site they want to see (because the window is too small) 
and they have now lost their portal site, which they need to open other 
sites in order to compare for their research, etc.


Not entirely sure why this is determined after the script has been
called though?  Why not have the list of links modified to force a new
target on the initial link rather than on submission?  


I am modifying current open sourced software that's already in place, 
though not yet in production mode for our users.

Does that help explain why I need it?  What would you suggest at this
point?

Sort of. What I don't understand is why do you have to decide on the
server side, post-request that the result will be in a new window? 
Couldn't the original "portal" page just use targets like normal?
It's a database driven site and so, unfortunately, it is all server
side, at least for this purpose.  So are you telling me there's no real
way in perl to do this?
Tim
Tim McGeary
Senior Library Systems Specialist
Lehigh University
610-758-4998
[EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: garbage errors when number of characters in script exceeds some number

2004-07-13 Thread Ken Rearick
I discovered last night that if I eliminate the switch statements the
problem go away. This morning I also tried moving the use switch in side the
if blocks containing the switch statements. This also eliminated the
problem.


"Ken Rearick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I wrote an application last week and when I attempted to compile it on
> both a sun and pc using perl5 I keep getting garbage error message when
> the character count of the source was greater than about 16,000
> characters. If I went into the source and removed white spaces to reduce
> the character count below this point the compile would work fine. But as
> soon as I added additional functionality that increased the character
> count above some magic number I would start getting these garbage error
> messages until I deleted more white space. The application works but the
> source is very had to read with no indenting and no comments.
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: MIME coding & flags for sending a .csv or Excel file (Question)

2004-07-13 Thread jason corbett
Thanks John. This was my first PERL program that I wrote and I wasn't sure when to use 
the my vs the our, but your points are well respected. I need more practice to 
understand how the functions/script work so that I can condense the programming 
better. 
 
Question: Is the scalar function always use to return values in a sub? Or is this a 
quick and easy way to do this without using the actual return statement?
Thanks,
JC

"John W. Krahn" <[EMAIL PROTECTED]> wrote:
On Monday 12 July 2004 08:21, jason corbett wrote:
>
> Here is the script that I am using. Remember that the script creates
> the file perfectly and stores the file with data in a folder on the
> server. The emailed copy is being sent out blank.
>
> #!/usr/bin/perl

use warnings;

> use strict;
> use DBI;
> use lib '/home/samcsm/jason/myperl/lib/perl5/site_perl/';
> use MIME::Lite;
>
>
> our ($dbh); #
> our (@files); #
> our ($filename); #
> our ($errorlog); #logs all successes and failures of the report
> our ($dirfolder); #where the treatment report is sent prior to emailing
> our (@record); #holds all records returned from query
> our ($success_var); #flags the script if completion was successful or not
> our ($sql); #
> our ($sth); #
> our ($dayreport); #
> our ($process_date); #used in the log file to tell what date and time a file 
> complete or failed
> our ($month); #
> our ($day); #
> our ($year); #
> our ($truename); #Time stamps the name of each treatment report AFTER the GENERIC 
> name is changed
> our (@times); #Helps Timestamp the treatment reports each day
> our ($reportlog); #Folder for keeping up with all Treatment reports
> our ($fourdayreport); #the path that leads to the location of the generic 4 day 
> report
> our ($recordlist); #allows the for manipulation of data retrieved from query

You should really use 'my' instead or 'our' to declare variables
unless you REALLY REALLY need 'our'. The parentheses are not
required unless you are declaring more then one variable.

our $variable; # no parens required
our ( $var1, $var2 ); # Must use parens

If you had used the warnings pragma you would have been told that
@files, $filename and @record are not being used anywhere which
brings up the next point. You should declare your variables when
you first use them instead of all at the beginning of the program.


> #set up for the file naming covention
> @times = (localtime)[3..5]; # grabs year/month/day values
 ^^
I had to do a double take when I read this. The comment says
year/month/day but the code says day/month/year.


> $month = $times[1] + 1;
> $day = $times[0];
> $year = $times[2] + 1900;

You don't really need the @times array at all:

my ( $day, $month, $year ) = (localtime)[3..5];
$month += 1;
$year += 1900;


> $truename = "Tr0"."$month"."0"."$day"."$year"."_4day.csv\n"; #Time stamps each file 
> once generic file is renamed

Wow, interpolation AND concatenation. Perhaps either:

my $truename = 'Tr0' . $month . 0 . $day . $year . "_4day.csv\n";

Or:

my $truename = "Tr0${month}0$day${year}_4day.csv\n";


> [snip code]
>
> dateme(); #call dateme function and store value in $process_date

Your comment says that you are storing the value in $process_date
so why don't you code it like that:

my $process_date = dateme();


> $success_var = data_collect(); #call data_collection function and store the word 
> "success" #or "failed" in $success_var variable
>
> my $logvariable = logresults($success_var); #call the logresults function and send 
> the "success" or "failed"
>
> mailman(); #call mailman function
>
> print "$logvariable\n"; #print the results returned from logresults function
>
> close(OUTFILE); #close file for errorlog and query
> close(ERRORLOG);
>
> $dbh->disconnect; #disconnet
>
>
> #---SUB ROUTINE FOR COLLECTING 
> DATA---

[ whitespace changed to show error ]

> sub data_collect
> {
> unless (open(OUTFILE,">$fourdayreport")) #open 4daytreatment.csv
> {
> die open(ERRORLOG, ">>$errorlog") && #or die and open errorlog.txt
> print ERRORLOG "Sorry file $dayreport couldn't be created\n";
> return "Failed";
> } #print into errorlog.txt message
> else{
> while( my @record= $sth->fetchrow_array()) #while theres data, collect
> {
> $recordlist=join(",",@record); #separate records with a "," and store
> print OUTFILE "$recordlist\n"; #print to newformatted records to
> #the generic file 4daytreatment.csv
> }
> return "success"; #send back the word "success" when done
> }

You are missing the closing subroutine brace!!!

> [snip code]
>
> #---SUB ROUTINE for Time 
> Stamp-
> sub dateme{
> $process_date=localtime(); #call localtime funcion and store as scalar value
>
> }return $process_date; #return scalar value of the localtime function

Your return statement is OUTSIDE the subroutine!!!
You are returning a value but you DON'T

Re: new window on redirect

2004-07-13 Thread Wiggins d Anconia
Please bottom post...

> Sorry, I didn't mean to not include everyone on my reply...
> 
> The reason I need a new window (and I did actually mean _blank), is 
> because this is for a Library portal site which has a limited window 
> view.  Our users actually (almost) demand a new window because they 
> don't want to have to hit their back button 20 times to get back to 
> their customized list of electronic Library resources.
> 

Ah, I love tab capable browsers ;-). (I know it is unreasonable to force
your users to use one.)

> And so, if I don't open a new window, then they will complain that they 
> cannot see the site they want to see (because the window is too small) 
> and they have now lost their portal site, which they need to open other 
> sites in order to compare for their research, etc.
> 

Not entirely sure why this is determined after the script has been
called though?  Why not have the list of links modified to force a new
target on the initial link rather than on submission?  

> I am modifying current open sourced software that's already in place, 
> though not yet in production mode for our users.
> 
> Does that help explain why I need it?  What would you suggest at this
point?



Sort of. What I don't understand is why do you have to decide on the
server side, post-request that the result will be in a new window? 
Couldn't the original "portal" page just use targets like normal?

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: new window on redirect

2004-07-13 Thread Tim McGeary
Sorry, I didn't mean to not include everyone on my reply...
The reason I need a new window (and I did actually mean _blank), is 
because this is for a Library portal site which has a limited window 
view.  Our users actually (almost) demand a new window because they 
don't want to have to hit their back button 20 times to get back to 
their customized list of electronic Library resources.

And so, if I don't open a new window, then they will complain that they 
cannot see the site they want to see (because the window is too small) 
and they have now lost their portal site, which they need to open other 
sites in order to compare for their research, etc.

I am modifying current open sourced software that's already in place, 
though not yet in production mode for our users.

Does that help explain why I need it?  What would you suggest at this point?
Thanks,
Tim
Tim McGeary
Senior Library Systems Specialist
Lehigh University
610-758-4998
[EMAIL PROTECTED]

Wiggins d Anconia wrote:
I want my web page redirect to open in a new window, as if I were 
putting "target=_new" in the html of the URL.  How can I do that using 
CGI.pm's redirect?  I have this:

print $output->redirect($u)
with $u being the URL I am redirecting, too.

The problem is that the redirect is providing an HTTP header back with
the new location and a result code that instructs the browser to find
the page at the new location, this is working at the protocol level
which has no knowledge of windows, targets, etc. So using 'redirect' is
not likely to get you anywhere at the client level.  

Generally I would think your best bet would be to have the link itself
use a standard target, which for some reason you seem to be avoiding,
reasons?  Alternatively you could pass back some javascript for the
onLoad handler and have it pop the new redirect in a new window, but the
problem I see here is that the browser will have already cleared the
window's contents and "loaded" a new page, so the same handler would
need to restore the previous contents, which gets real ugly, especially
if the referer is POST'ed.  I wouldn't even want to think about the
nightmares dealing with different versions of browsers + javascript,
etc.  However if your referer is static and you can guarantee it then it
wouldn't be as much of a problem.
http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: new window on redirect

2004-07-13 Thread Wiggins d Anconia
> I want my web page redirect to open in a new window, as if I were 
> putting "target=_new" in the html of the URL.  How can I do that using 
> CGI.pm's redirect?  I have this:
> 
> print $output->redirect($u)
> 
> with $u being the URL I am redirecting, too.
> 

The problem is that the redirect is providing an HTTP header back with
the new location and a result code that instructs the browser to find
the page at the new location, this is working at the protocol level
which has no knowledge of windows, targets, etc. So using 'redirect' is
not likely to get you anywhere at the client level.  

Generally I would think your best bet would be to have the link itself
use a standard target, which for some reason you seem to be avoiding,
reasons?  Alternatively you could pass back some javascript for the
onLoad handler and have it pop the new redirect in a new window, but the
problem I see here is that the browser will have already cleared the
window's contents and "loaded" a new page, so the same handler would
need to restore the previous contents, which gets real ugly, especially
if the referer is POST'ed.  I wouldn't even want to think about the
nightmares dealing with different versions of browsers + javascript,
etc.  However if your referer is static and you can guarantee it then it
wouldn't be as much of a problem.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: new window on redirect

2004-07-13 Thread David Dorward
On 13 Jul 2004, at 14:37, Tim McGeary wrote:
I want my web page redirect to open in a new window, as if I were 
putting "target=_new" in the html of the URL.
Which isn't allowed under HTML. You are probably thinking of _blank.
http://www.w3.org/TR/html4/types.html#h-6.16
How can I do that using CGI.pm's redirect?
print $output->redirect($u)
You can't... well... there is the Window-Target not-really-http-header 
but, last I heard, browser support for that (thankfully) sucks.
http://diveintoaccessibility.org/day_16_not_opening_new_windows.html

--
David Dorward
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Reading a variable file name

2004-07-13 Thread James Edward Gray II
On Jul 13, 2004, at 8:31 AM, [EMAIL PROTECTED] wrote:
Greetings,
Howdy.
Would someone be kind enough to point me in the right direction to 
solve this
problem?
I'll sure try.
An application creates XML files in a subdirectory, which I then 
convert to
EDI.  That part is now working fine.  My problem is that the 
application
creates files during the day, with slightly different names.  For 
example:

File0001.xml
File0002.xml
File0244.xml
We can sure make a regex for that, right?
m/^File\d+\.xml$/
The file names vary based on what part of the application creates them.
There seems to be no pattern of the number after the alpha characters. 
 I need to
read each of these files, and concatenate them into a single EDI file.
Do you know how to read the listing of files in a directory?  Three 
steps:

opendir DIR, 'path/to/dir' or die "Directory error:  $!";  # open dir
my @files = grep m/^File\d+\.xml$/, readdir DIR;  # get file listing 
using earlier regex

closedir DIR;  # clean up after ourselves, as all good programmers 
should

# loop over @files down here...
The  only files in the subdirectory need to be processed;  and all of 
the files in
the subdirectory need to be processed.
Was that line English?You lost me here.  If I haven't 
solved your problem yet, try me again on this part.

Could someone point me in the right direction?
Hope that helps.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



new window on redirect

2004-07-13 Thread Tim McGeary
I want my web page redirect to open in a new window, as if I were 
putting "target=_new" in the html of the URL.  How can I do that using 
CGI.pm's redirect?  I have this:

print $output->redirect($u)
with $u being the URL I am redirecting, too.
Thanks,
Tim
--
Tim McGeary
[EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Permutations (and optimisations)

2004-07-13 Thread Ramprasad A Padmanabhan
Good effort.
But I use *Algorithm::Permute* 


Thanks
Ram
Robin wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hey, I have written a function that maybe others will find useful to play 
with. It takes a list and then calls a specified function on that list. I'm 
wondering if anyone knows of anything to optimise the code, as there are a 
few list copies going on that allocate/deallocate many times. Is this a 
problem, or is Perl pretty smart about it?

(to be clearer, given a list ('a','b','c') it will call the function many 
times, each time giving one of: ('a','b','c'), ('a','c','b), ('b','a','c'),
('b','c','a'), ('c','a','b') and ('c','b','a'). It also prints progress on 
stderr, but that is more for my own benefit)

It can be called with something like:
permute { push @result, [EMAIL PROTECTED] } @inputList;
if you want to build a list of all the results in @result.
The function is:
# This function takes a list of values, and calls a referenced
# function on each permutation of the list. The first argument is the
# function, the second is the list (there is a third argument used
# internally only.) Note that there are going to be a lot of
# combinations, n!, where n is the number of items in the list.
sub permute(&\@;\@) {
   my $func = shift();
   my @srcList = @{ shift() };
   my @dstList;
   if (@_) {
   @dstList = @{ shift() };
   }
   if (@srcList) {
   # Copy the srcList, pop an entry off the copy, recurse with that
   # appended to the dstList.
   my @srcCopy = @srcList;
   while (@srcCopy) {
   if ([EMAIL PROTECTED]) {
   print STDERR @srcCopy."/"[EMAIL PROTECTED]"\n";
   }
   my $value = pop(@srcCopy);
   # Make another copy of srcList, and remove only the one that
   # we are moving. This copy will be passed on to the next
   # iteration.
   my @srcCopy2 = @srcList;
   splice(@srcCopy2, scalar @srcCopy, 1);
   my @tList = (@dstList, $value);
   permute(\&$func, @srcCopy2, @tList);
   }
   } else {
   # base case
   &$func(@dstList);
   }
}
- -- 
Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]>

Hostes alienigeni me abduxerunt. Qui annus est?
PGP Key 0x776DB663 = DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA88QJzTjgendttmMRAkCvAJ0Vsy9oPCCU0AQJngntWojFR4ZymQCcDrIQ
7+vi4wbRFzMrELWdipAZoQw=
=Xhei
-END PGP SIGNATURE-
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Reading a variable file name

2004-07-13 Thread RHug505456
Greetings,

Would someone be kind enough to point me in the right direction to solve this 
problem?

An application creates XML files in a subdirectory, which I then convert to 
EDI.  That part is now working fine.  My problem is that the application 
creates files during the day, with slightly different names.  For example:

File0001.xml
File0002.xml
File0244.xml

The file names vary based on what part of the application creates them.  
There seems to be no pattern of the number after the alpha characters.  I need to 
read each of these files, and concatenate them into a single EDI file.  The 
only files in the subdirectory need to be processed;  and all of the files in 
the subdirectory need to be processed.

Could someone point me in the right direction?

Thanks for your help.

Richard Hug
New Tampa Consulting
813-361-7946


re:problem with regexp

2004-07-13 Thread Jeff 'japhy' Pinyan
On Jul 13, Goncalves, Jorge (Ext) said:

>print "\n$DCICLIENTDIR\\logicalPMF.exe -f
>$DCICLIENTDIR\\config$NOM_PMF.cfg\n";
> print ($_);
>my $var1="$DCICLIENTDIR\\logicalPMF.exe -f
>$DCICLIENTDIR\\config$NOM_PMF.cfg\n";
> my $line=($_);
>  if ($_ =~ m /$var1/)
> {
>   $Ajout=0;
> }

>D:\muse\lotus\notes\logicalPMF.exe -f D:\muse\lotus\notes\config.cfg
>D:\muse\lotus\notes\logicalPMF.exe -f D:\muse\lotus\notes\config.cfg
>-pmfType Logical -id
>
>$Ajout=1 always.  the if never match the patern $var1.

That is because $var1 contains backslashes, which are interfering with its
use as a regex.  Long story short, you should either do:

  if ($_ eq $var1) { ... }

if you want to test for EQUALITY, or

  if ($_ =~ /\Q$var1/) { ... }
  # or
  if (index($_, $var1) > -1) { ... }

to test if $var1 is contained SOMEWHERE in $_.

-- 
Jeff "japhy" Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regex for numbers and text

2004-07-13 Thread Jeff 'japhy' Pinyan
On Jul 11, Jeff 'japhy' Pinyan said:

>I tend to write that as /(-?\d+\.?\d*)/, but be aware that this doesn't
>match numbers like .52 or .9, because they don't have digits BEFORE the
>decimal point.

I've seen the response of /-?(?:\d+\.?\d*|\.\d+)/, and while that does
work, it seems too noisy to me.  What we would really like to be able to
say is /-?\d*\.?\d*/, but you should be able to see that could match "-."
and "." and "", which we decided aren't legitimite numbers.

So use a look-ahead.

  /(-?(?=.?\d)\d*\.?\d*)/

*That* regex requires some explanation.  Who will give it?

-- 
Jeff "japhy" Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Permutations (and optimisations)

2004-07-13 Thread Robin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey, I have written a function that maybe others will find useful to play 
with. It takes a list and then calls a specified function on that list. I'm 
wondering if anyone knows of anything to optimise the code, as there are a 
few list copies going on that allocate/deallocate many times. Is this a 
problem, or is Perl pretty smart about it?

(to be clearer, given a list ('a','b','c') it will call the function many 
times, each time giving one of: ('a','b','c'), ('a','c','b), ('b','a','c'),
('b','c','a'), ('c','a','b') and ('c','b','a'). It also prints progress on 
stderr, but that is more for my own benefit)

It can be called with something like:
permute { push @result, [EMAIL PROTECTED] } @inputList;
if you want to build a list of all the results in @result.

The function is:
# This function takes a list of values, and calls a referenced
# function on each permutation of the list. The first argument is the
# function, the second is the list (there is a third argument used
# internally only.) Note that there are going to be a lot of
# combinations, n!, where n is the number of items in the list.
sub permute(&\@;\@) {
my $func = shift();
my @srcList = @{ shift() };
my @dstList;
if (@_) {
@dstList = @{ shift() };
}
if (@srcList) {
# Copy the srcList, pop an entry off the copy, recurse with that
# appended to the dstList.
my @srcCopy = @srcList;
while (@srcCopy) {
if ([EMAIL PROTECTED]) {
print STDERR @srcCopy."/"[EMAIL PROTECTED]"\n";
}
my $value = pop(@srcCopy);
# Make another copy of srcList, and remove only the one that
# we are moving. This copy will be passed on to the next
# iteration.
my @srcCopy2 = @srcList;
splice(@srcCopy2, scalar @srcCopy, 1);
my @tList = (@dstList, $value);
permute(\&$func, @srcCopy2, @tList);
}
} else {
# base case
&$func(@dstList);
}
}


- -- 
Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0x776DB663 = DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA88QJzTjgendttmMRAkCvAJ0Vsy9oPCCU0AQJngntWojFR4ZymQCcDrIQ
7+vi4wbRFzMrELWdipAZoQw=
=Xhei
-END PGP SIGNATURE-

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




re:problem with regexp

2004-07-13 Thread Goncalves, Jorge (Ext)
Hi list
i have this snippet:

$Ajout=1;
while ()
 {

print "\n$DCICLIENTDIR\\logicalPMF.exe -f
$DCICLIENTDIR\\config$NOM_PMF.cfg\n";
 print ($_);
my $var1="$DCICLIENTDIR\\logicalPMF.exe -f
$DCICLIENTDIR\\config$NOM_PMF.cfg\n";
 my $line=($_);
  if ($_ =~ m /$var1/)
 {
   $Ajout=0;
 }
 }

althought in the console i have this:
D:\muse\lotus\notes\logicalPMF.exe -f D:\muse\lotus\notes\config.cfg
D:\muse\lotus\notes\logicalPMF.exe -f D:\muse\lotus\notes\config.cfg
-pmfType Logical -id

$Ajout=1 always.  the if never match the patern $var1.

Thanks for your help.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regex for numbers and text

2004-07-13 Thread Randy W. Sims
Gunnar Hjalmarsson wrote:
Randy W. Sims wrote:
Jerry Preston wrote:
What needs to be changed in /(-?\d+\.?\d*)/ so that it also see
number like .59?

This is why I like to recommend Regexp::Common. But...

use warnings;
use Regexp::Common 'number';
$_ = '.';
/^$RE{num}{real}$/ and print "\"$_\" is a number.\n";
my $x = 1 if $_ < 5;
Outputs:
"." is a number.
"." isn't numeric in numeric lt (<) at ...
Regexp::Common considers an alone decimal point to be a number, while
the Perl compiler does not. Did you know that?  ;-)
Hrm, that's unfortunate :-/
Well, I'll still take this as an argument in favor of using modules like 
Regexp::Common. If your original regex were used: '(-?\d+(?:\.\d+)?)' 
and if it were used in more than one application, it would have to be 
changed everywhere. If, OTOH, Regexp::Common were used, we need only 
make the correction in one place and it is fixed everywhere.

BTW, I've posted the following to RT:
[cpan #6940] lone . (decimal) considered a match for $RE{num}{real}
-
perl -MRegexp::Common=number -e 'print "oops\n" if "." =~ /$RE{num}{real}/'
This was pointed out to me by Gunnar Hjalmarsson in a thread on 
<[EMAIL PROTECTED]> ...

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Regex for numbers and text

2004-07-13 Thread Gunnar Hjalmarsson
Randy W. Sims wrote:
Jerry Preston wrote:
What needs to be changed in /(-?\d+\.?\d*)/ so that it also see
number like .59?
This is why I like to recommend Regexp::Common. But...
use warnings;
use Regexp::Common 'number';
$_ = '.';
/^$RE{num}{real}$/ and print "\"$_\" is a number.\n";
my $x = 1 if $_ < 5;
Outputs:
"." is a number.
"." isn't numeric in numeric lt (<) at ...
Regexp::Common considers an alone decimal point to be a number, while
the Perl compiler does not. Did you know that?  ;-)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: memory allocation in perl

2004-07-13 Thread Randy W. Sims
Anish Mehta wrote:
You'll need to be more specific. There is no explicit memory 
allocation in perl (well, actually, you can treat a string as a chunk 
of memory). What exactly do you want to know?

Randy.

I want to whether we have some sort of allocation method as we have in C 
where we have memory allocated from heap, stack for different types of 
memory allocations.
In perl there are only two basic ways to allocate variables. The package 
variable which would be roughly analogous to C's static variables and 
the 'my' variable which is allocated "on the stack" like auto variables 
in C. That's it as far as perl is concerned. As I alluded to in my 
previous post, you can treat a string like a chunk of memory:

my $mem = ' ' x 1024;
gives you a 1 kb chunk of "memory". You can then "store" and "retrieve" 
variables by using pack and unpack. It's rare that you would want to do 
this, however; the only thing that occurs off-hand is reading in a file 
that contains data encoded in a binary format.

> As far as my knowledge in perl is concerned it
> runs C code internally.  I am not getting how do a variable gets stored
> with perl.
Perl doesn't run C code internally. It is implemented in C. The perl 
code is never translated to C.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: memory allocation in perl

2004-07-13 Thread Anish Mehta
You'll need to be more specific. There is no explicit memory 
allocation in perl (well, actually, you can treat a string as a chunk 
of memory). What exactly do you want to know?

Randy.

I want to whether we have some sort of allocation method as we have in C 
where we have memory allocated from heap, stack for different types of 
memory allocations.   As far as my knowledge in perl is concerned it 
runs C code internally.  I am not getting how do a variable gets stored 
with perl.

Thanks for your response.
Regards..
A+
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: memory allocation in perl

2004-07-13 Thread Randy W. Sims
Anish Mehta wrote:
Hello Everyone!
I would like to have your consideration regarding my query. I want to 
know about the memory allocation of variables in perl..
You'll need to be more specific. There is no explicit memory allocation 
in perl (well, actually, you can treat a string as a chunk of memory). 
What exactly do you want to know?

Randy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]