[22483] in Perl-Users-Digest
Perl-Users Digest, Issue: 4704 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 13 11:07:20 2003
Date: Thu, 13 Mar 2003 08:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 13 Mar 2003 Volume: 10 Number: 4704
Today's topics:
Re: Alternatives to FormMail (Dave Cross)
Creating a dynamic list of filehandles <mark.drummond@stantive.com>
Re: Expand ENV var within another ENV var <jurgenex@hotmail.com>
Re: Grabbing module name on the fly <noreply@gunnar.cc>
HoH vs. more memory efficient way to sum log entries? adam@pls.posthere.com
Re: How to get an (almost) absolute path <brian.bygland@garbage.boeing.com>
how to install dbi Module on perl (ramesh)
Re: Merging log files using hash - good idea/possible? <singleantler-news@hotmail.com>
Re: panic error (Smiles)
Re: perl locks up my win98 computer (Nataku)
problems when installing cpan (ramesh)
Re: Question about the filehandle example in the perl F <oxmard.Rules@ab.ab>
Re: remove anything from string except two words <noreply@gunnar.cc>
Re: return value of 'accept' in PF_UNIX sockets <mzawadzk@man.poznan.pl>
Re: return value of 'accept' in PF_UNIX sockets <billy@arnis-bsl.com>
Simple Traversing Many-Dimensional Array Question (JR)
Stupid Perl Questions (JohnFrog)
Re: Stupid Perl Questions (Helgi Briem)
Re: Telnet.pm, buffering output (sean)
Re: what is current user from .htaccess? <usenet@dwall.fastmail.fm>
Re: What's wrong with the Perl docs <tore@aursand.no>
Re: What's wrong with the Perl docs (Helgi Briem)
XPATH vs Regular Expressions <none@none.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Mar 2003 06:21:27 -0800
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Alternatives to FormMail
Message-Id: <9d3debce.0303130621.4106c290@posting.google.com>
sbour@niaid.nih.gov (Steph) top-posted
news:<79e85d7d.0303121139.73dc1620@posting.google.com>...
> Actually, I ask this like I know there are many but I don't know which
> one to use ;-) At this point I'm using FormMail from the London Perl
> Mongers nms project (Matt Wright's code emulation).
> So I'll rephrase: what is in your opinion the best combination of perl
> script and email service for web forms. I'm looking at SendMail.cgi
> and it looks like it could possible do both. However the doc is a
> little slim for a newbie like me and I'm not sure how to modify my web
> forms to use SendMail.cgi instead of the current formmail/sendmail
> combination.
Have you considered the nms_sendmail script that you can also get from
nms?
Or, the latest version of the nms formmail script don't need an
external email program, you can configure it to talk directly to an
SMTP server.
Dave...
------------------------------
Date: Thu, 13 Mar 2003 09:34:39 -0500
From: Mark Drummond <mark.drummond@stantive.com>
Subject: Creating a dynamic list of filehandles
Message-Id: <b4q4td$1hm$1@eastnews1.East.Sun.COM>
Hi all. I want to create a set of filehandles, based on a list of
"things" in another file. For example, say I have a file which contains
the names of all the disks in a disk array, something like this:
c0t0d0
c0t1d0
c1t0d0
c1t1d0
.
.
.
Now let's say I have aanother (single) file with performance data on all
these disks, like iostat output. I want to take that performance data
and sift it into a set of files based on the disk names. So I want to
create a set of files named "$diskname.dat" and then write data lines
for each disk into it's own file.
Maybe I am missing something obvious, but I cannot figure out a way to
this in a generic manner, so it will work with an arbitrary list of
disk, or cpus, or other "things". I think I could do it if I used a
single filehandle and used a variable for the filename like:
[not syntactically correct]
foreach $dataline {
match the correct object (disk, cpu, whatever) {
open FOO, $object.dat
write FOO $bar
}
}
But that solution, if workable, would result in me opening and closing
the files thousands of times each. I would prefer to just open each file
once, something more like:
open $FOO, $object.dat
Though I am guessing that is not possible?
Any ideas?
Mark
------------------------------
Date: Thu, 13 Mar 2003 14:56:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Expand ENV var within another ENV var
Message-Id: <s_0ca.2909$Ad6.1265@nwrddc01.gnilink.net>
Michael wrote:
> HELP. using one var to setup multipe vars as follows:
>
> $ENV{LOCALPATH} = /opt/perfmet;
> $ENV{LIB} = $ENV{LOCALPATH}/lib;
You are dividing the value of $ENV{LOCALPATH} by lib.
Use quotes instead or concatenate the individual pieces of your text.
Besides, lib is a bareword and perl should have given you an error message.
jue
------------------------------
Date: Thu, 13 Mar 2003 16:28:03 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Grabbing module name on the fly
Message-Id: <b4q814$22mls9$1@ID-184292.news.dfncis.de>
Anno Siegel wrote:
> With object methods it should hardly come as a surprise that the object
> in "$obj->method(...)" can be given as a variable. The same is true for
> the class in a class method call. After all, the object or class is
> just another parameter in the actual call, though given in an unusual
> position.
Well, surprise or not may depend on how much Perl you know to start
with. OOP, for instance, is one of the things I simply do not really
understand yet...
> Incidentally, a method can also be given as a hard (code-) reference:
>
> my $meth = sub { my $self = shift; ... };
> $obj->$meth(...);
Mmm..
It's amazing to realize that there seems to be a number of optional
solutions to my initial problem, that I hadn't thought about. I have
learned some useful stuff through this thread. Need to read more.
Thanks Anno! Thanks Steve!
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 13 Mar 2003 15:29:15 GMT
From: adam@pls.posthere.com
Subject: HoH vs. more memory efficient way to sum log entries?
Message-Id: <bk817vgm8d2lqojd6ofatrj9fi843hglnj@4ax.com>
Hi,
I use this script or one like it for lots of handy counting jobs. In
the case below I am creating a Hash of a Hash to sum up the amount of
data each "page type" has. So expected output would look like this:
www.somesite.com nonpub.htm = 496343 (that's in bytes)
But since I am running it on the squid logs for the entire month of
February (and our cache is big/busy), it is running out of memory. Do
any of you know of a more memory efficient way to do such a count?
Other suggestions for code improvement always welcome.
thanks,
Adam
#!/usr/bin/perl -w
$squidlog="./feb_squid_logs";
open(LOG,"$squidlog") || die "cannot open $squidlog: $!";
foreach $match (<LOG>)
{
( $junk, $junk, $junk, $junk, $junk, $junk, $junk, $junk, $bytes,
$junk, $url, $junk, $junk, $junk ) = split(/ +/, $match);
next unless ($bytes > 30000); # only count/sum objects that
are larger than 30K
$file_object = $url;
$front_url = $url;
$file_object =~ s#^.*/(.*)#$1#g;
$front_url =~ s#^http://(.*?)/+.*#$1#g;
if ($file_object ne "" ) {
$HoH{$front_url}{$file_object} += $bytes;
}
}
foreach $domain ( keys %HoH ) {
foreach $file ( keys %{ $HoH{$domain} } ) {
print "$domain: $file = $HoH{$domain}{$file} \n";
}
print "\n";
}
------------------------------
Date: Thu, 13 Mar 2003 15:44:43 GMT
From: Brian Bygland <brian.bygland@garbage.boeing.com>
Subject: Re: How to get an (almost) absolute path
Message-Id: <3E70A76B.D679EC90@garbage.boeing.com>
Tore Aursand wrote:
>
> On Thu, 13 Mar 2003 00:04:20 +0000, Brian Bygland wrote:
> > I'm on UNIX. I need to resolve a relative path to an absolute path with
> > one unusual condition.
> > [...]
>
> I really don't know if this helps you, but have you tried 'File::Spec' in
> addition to 'Cwd'?
>
> --
> Tore Aursand <tore@aursand.no>
I'll look into it. Thanks.
------------------------------
Date: 13 Mar 2003 06:44:38 -0800
From: rpalla@kentlaw.edu (ramesh)
Subject: how to install dbi Module on perl
Message-Id: <2b0865a8.0303130644.7cfc0706@posting.google.com>
HI
I am trying to install DBI module on perl...but I am not able to. I
am getting lot of errors. Can anybody tell me the exact
procedure....how to install dbi module.
Thanks
Ram
------------------------------
Date: Thu, 13 Mar 2003 15:48:21 +0000
From: Paul Silver <singleantler-news@hotmail.com>
Subject: Re: Merging log files using hash - good idea/possible?
Message-Id: <eb917v0c4rgieimaap0jig64p5rpai9ech@4ax.com>
On 11 Mar 2003 10:37:04 -0800, (Thomas) wrote:
>a year ago we also tried to merge our logfiles. The experience was
>bad, since it was harder than expected to get a good merge that would
>generate correct statistics in Webtrends. Also, the fact of having to
>post-process the data every day, made us choose to buy the server
>license from Webtrends. After doing this, the statistics have run
>without problems. I would recommend to buy the extra licence, even
>though the fee is pretty high.
Really? We were using a ColdFusion script to do it, but this ran very
slowly (as expected, it wasn't using the right language for the job,
it was just a quick fix, as in the writing rather than the
processing,) but we've never had a problem the files it compiled.
Using the Perl script I've worked up with the help given by dw, I've
now merged the files for the last month for four sites, and we haven't
noticed any anomalies, though we will be keeping an eye on it for a
while.
Considering the other benefits the upgrade would have given us, which
were very little, I don't see why we should pay almost £3,000
(~$4,500) to Webtrends for a problem that was quite straightforward to
fix. The files are automatically compiled during the night, so
post-processing doesn't take any effort, and we certainly haven't
spent £3,000 fixing the problem. When we add another server to the
cluster, I don't expect it to take another £900 (the cost of an extra
license) to update the script. And lets not get in to the renewal
fees, which we won't have to pay next year as the script will be
written and still working.
Webtrends is a great product, but really, we can't afford to pay such
a high amount just to make it read two log files for one day instead
of one.
Paul.
--
Please remove '-news' from address to send e-mail.
------------------------------
Date: 13 Mar 2003 08:02:26 -0800
From: smileypete2@yahoo.com (Smiles)
Subject: Re: panic error
Message-Id: <63ccfece.0303130802.71a9059b@posting.google.com>
Hehe, I kind of figured. The funny part is it took me forever to get
this far because of a memory leak in pop and shift for shared arrays.
Had to create a slightly altered version of Thread::Queue to get
around that one.
Thanks for telling me how to post the bug. Unfortunately, it will
take me quite some time just figure out what the cause is, because the
code is not *SMALL* and I don't know exactly what the last thing
executed was :(
smiles
Abigail <abigail@abigail.nl> wrote in message news:<slrnb6v61v.1ud.abigail@alexandra.abigail.nl>...
> Smiles (smileypete2@yahoo.com) wrote on MMMCDLXXX September MCMXCIII in
> <URL:news:63ccfece.0303120802.1e025b69@posting.google.com>:
> ~~ I'm not exactly a newbie. But I have never recieved a panic error
> ~~ until now. I am running:
> ~~
> ~~ Perl Version: Activestate Perl 5.8.0 Build 804.
> ~~ OS: Windows 2000 Service Pack 3
> ~~
> ~~ The error is "panic: COND_INIT (1816)". The application I am writing
> ~~ uses threads and I believe it has something to do with that. If I
> ~~ increase the number of threads the error appears sooner than later.
> ~~
> ~~ I would appreciate it if anyone could bring this to light for me.
>
>
> That's a bug in perl. It should never happen. Please write a *SMALL*
> program that triggers this behaviour, and use the perlbug command
> to report it.
>
>
>
> Abigail
------------------------------
Date: 13 Mar 2003 07:25:47 -0800
From: Crapnut566@yahoo.com (Nataku)
Subject: Re: perl locks up my win98 computer
Message-Id: <7e48fc99.0303130725.217d63b9@posting.google.com>
Hm ... if PPM is giving you problems im not too sure what the issue
could be. Unless it was a bad install, PPM really shouldnt have that
much overhead.
ebct@hotmail.com (Irwin Feuerstein) wrote in message news:<542d2ca5.0303080727.16ba8623@posting.google.com>...
> Yes, but with most conflicts, it comes and goes. When I type PPM, it
> hangs my machine every time. I am not used to seeing that with DOS
> type programs. Does anyone know of any programs or loaded utilities
> that consistently conflict with perldoc, or with PPM? Am I the only
> one here having this problem? Seems like it, from the paucity of
> similar messages on Google searching.
>
> Thanks,
>
> Irwin
>
>
>
>
>
>
>
>
>
>
> Crapnut566@yahoo.com (Nataku) wrote in message news:<7e48fc99.0303060800.62dfb544@posting.google.com>...
> > I would imagine that since you are running Win98, you probably dont
> > have too much RAM on your system. This could be the cause. Im
> > assuming you have the correct distrobution via activestate.
> >
> > Ignore all the MS cynicism that is present near everywhere. I have
> > never had a problem running perl under windows myself. Im guessing
> > its either hardware, or a specific issue with your windows install.
> >
> > Sorry I cant be of much help, but OS lockups are hard to diagnose.
> >
> > James McIninch <james.mcininch@attbi.com> wrote in message news:<NHB9a.378452$Ec4.380535@rwcrnsc52.ops.asp.att.net>...
> > > On Wednesday 05 March 2003 07:15 pm, Doglover posted to comp.lang.perl.misc:
> > >
> > > > Hi. Does anyone know why Perl locks up my win98 machine when I do
> > > > simple things like type PPM, or perldoc perldoc?
> > >
> > > This is a feature of Microsoft Windows. It's one of the things that
> > > differntiates it from other operating system products on the market.
> > >
> > >
> > > > Can't even do
> > > > control-alt-delete. It is totally locked. Simple "hello world" scripts
> > > > run fine. Seems to be with both 5.6.1 and with 5.8.0, since I tried
> > > > both. Strange, because 5.6 used to work. Then I tried 5.8, and started
> > > > locking up. Uninstalled, and went back to 5.6, still locked up. So now
> > > > I am back at 5.8.
> > > >
> > > > A google search revealed almost nothing.
------------------------------
Date: 13 Mar 2003 07:50:23 -0800
From: rpalla@kentlaw.edu (ramesh)
Subject: problems when installing cpan
Message-Id: <2b0865a8.0303130750.23f5104d@posting.google.com>
hi
I am getting errors when i am trying to install cpan module in perl.
getting messages saying objects not found.
can anybody help?
Ramesh
------------------------------
Date: Thu, 13 Mar 2003 09:51:46 -0600
From: "Peter Shankey" <oxmard.Rules@ab.ab>
Subject: Re: Question about the filehandle example in the perl FAQ
Message-Id: <0aOcnWsWl4aGNO2jXTWcqQ@comcast.com>
"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3E6FEE62.9050207@rochester.rr.com...
> perldoc perlop
>
> where it says:
>
>
> "If what's within the angle brackets is neither a filehandle nor a
> simple scalar variable containing a filehandle name, typeglob, or
> typeglob reference, it is interpreted as a filename pattern to be
> globbed, and either a list of filenames or the next filename in the list
> is returned, depending on context. This distinction is determined on
> syntactic grounds alone. That means <$x> is always a readline() from an
> indirect handle, but <$hash{key}> is always a glob(). That's because $x
> is a simple scalar variable, but $hash{key} is not--it's a hash element."
>
> In your case, <$FHArray[0]> is attempting to glob filenames which match
> the filename pattern $FHArray[0], whereas:
>
> $fh=$FHArray[0];
> ... <$fh> ...
>
> would have worked in the sense that it would have read from the stored
> filehandle.
Sounds like what perldoc is say the <> operator will try and glod, in my
case $FHArray[0]. In my case:
print ("FHArray is: ", $FHArray[0], "\n\n");
returned:
*main::FH
So my while(<$FHArray[0]>) was looking for a file with the name of:
*main::FH
Is that what was going on?
Thank you for your time.
Pete
------------------------------
Date: Thu, 13 Mar 2003 16:02:29 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: remove anything from string except two words
Message-Id: <b4q6h5$22m8lm$1@ID-184292.news.dfncis.de>
Pynex wrote:
> It works, but now I've seen that "Version" in $oldstring sometimes has
> two-digits before the point and in the brackets.
>
> Example :
>
> Version 5.6(12) and
> Version 12.3(5)
>
> Version 5.6(12) <--- this is show in $newstring
> Version 12.3(5) <--- this not
>
> I know that \d is for one digit. So that
>
> oldstring =~ s{((?:XZ-\d{4})|(?:Version \d\.\d\(\d\d\)))}
> { $newstring .= $1 . ' '; $1 }ge;
>
>
> is for ?.?(??) only, but now i want it for ??.?(??), too
>
> So I don't know what to do (again).
I do know what you should do: You should start studying perlre, in order
to get some basic understanding of regular expressions, and then try to
figure out one or two details by yourself. ;-)
http://www.perldoc.com/perl5.8.0/pod/perlre.html
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 13 Mar 2003 16:30:53 +0100
From: Marek Zawadzki <mzawadzk@man.poznan.pl>
Subject: Re: return value of 'accept' in PF_UNIX sockets
Message-Id: <Pine.GSO.4.44.0303131619580.26054-100000@rose.man.poznan.pl>
I'd like to rephrase my question:
How to get the full pathname of a client program connecting to my server
via local Unix domain socket (PF_UNIX) ?
In my understaning this is similar to the situation when one can get
remote client's IP when AF_INET is in use.
Any help will be appreciated.
-marek
------------------------------
Date: Thu, 13 Mar 2003 17:39:42 +0200
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: return value of 'accept' in PF_UNIX sockets
Message-Id: <b4q8nu$22pj42$1@ID-33095.news.dfncis.de>
Marek Zawadzki wrote:
> I'd like to rephrase my question:
>
> How to get the full pathname of a client program connecting to my server
> via local Unix domain socket (PF_UNIX) ?
> In my understaning this is similar to the situation when one can get
> remote client's IP when AF_INET is in use.
>
Doesn't look like a Perl-related question, however you could take a look at
Secure UNIX Programming FAQ (http://www.whitefang.com/sup/secure-faq.html),
section "4.4) How do I authenticate a non-parent process?"
HTH
--
Ilja.
------------------------------
Date: 13 Mar 2003 07:20:50 -0800
From: jrolandumuc@yahoo.com (JR)
Subject: Simple Traversing Many-Dimensional Array Question
Message-Id: <b386d54b.0303130720.1045a52a@posting.google.com>
Hi. I was playing around with different data structures, and forgot
the best means by which to traverse an array with more than two
dimensions.
I looked in the Perl Cookbook and Programming Perl books, and through
the Perl newsgroups for help, but I couldn't find any examples of how
to traverse a 3 or more dimensional array.
I used the below code to traverse my many-dimensional array, but I
think that I may be doing something wrong, if I need the next if and
if statements (I use the next if to avoid illegally using symbolic
references, under use strict, and the if statement to avoid printing
out a given array reference number), just to traverse the data
structure, under the use strict pragma.
Can someone help me with my brain freeze, and give me some sample code
to solve this simple little problem (unless this is the only way to do
it, which I doubt)?
I appreciate any advice anyone may be able to give.
Thanks!
JR
#
# Creating and traversing a many-dimensional array
#
#!/usr/bin/perl -w
use diagnostics;
use strict;
my @AoA = (
[ 0, 0, 0 ],
[ 1, 1, 1 ],
[
[ 2, 2, 2 ],
[ 3, 3, 3 ],
[
[ 4, 4, 4 ],
[ 5, 5, 5 ],
],
],
);
for my $a ( 0 .. $#AoA ) {
my $dim1 = $AoA[$a];
for my $b ( 0 .. $#{$dim1} ) {
print "Element $a $b is: $dim1->[$b]\n" if $dim1->[$b] !~
/ARRAY/;
my $dim2 = $AoA[$a][$b];
next if $dim2 !~ /ARRAY/;
for my $c ( 0 .. $#{$dim2} ) {
print "Element $a $b $c is: $dim2->[$c]\n" if $dim2->[$c] !~
/ARRAY/;
my $dim3 = $AoA[$a][$b][$c];
next if $dim3 !~ /ARRAY/;
for my $d ( 0 .. $#{$dim3} ) {
print "Element $a $b $c $d is: $dim3->[$d]\n" if
$dim3->[$d] !~ /ARRAY/;
}
}
}
}
=OUTPUT1
Element 0 0 is: 0
Element 0 1 is: 0
Element 0 2 is: 0
Element 1 0 is: 1
Element 1 1 is: 1
Element 1 2 is: 1
Element 2 0 0 is: 2
Element 2 0 1 is: 2
Element 2 0 2 is: 2
Element 2 1 0 is: 3
Element 2 1 1 is: 3
Element 2 1 2 is: 3
Element 2 2 0 0 is: 4
Element 2 2 0 1 is: 4
Element 2 2 0 2 is: 4
Element 2 2 1 0 is: 5
Element 2 2 1 1 is: 5
Element 2 2 1 2 is: 5
=OUTPUT1
------------------------------
Date: 13 Mar 2003 06:36:38 -0800
From: j0hnfr0g@yahoo.com (JohnFrog)
Subject: Stupid Perl Questions
Message-Id: <16008e62.0303130636.5d55706c@posting.google.com>
I have never used Perl, and I am wondering about this following things
(OS=Win2K):
1) Can I call and run DOS executables from a Perl script?
2) Can I easily create a standalone program (1 file) that runs under
DOS (command prompt) that contains my script and the Perl interpreter
(or just what is needed for my script), so that from an end-user
perspective it just looks like a DOS executable?
3) Is there a preferred place to download a Perl interpreter from?
Thanks,
John
------------------------------
Date: Thu, 13 Mar 2003 15:47:12 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Stupid Perl Questions
Message-Id: <3e70a61f.2951544927@news.cis.dfn.de>
On 13 Mar 2003 06:36:38 -0800, j0hnfr0g@yahoo.com (JohnFrog)
wrote:
>I have never used Perl, and I am wondering about this following things
>(OS=Win2K):
>
>1) Can I call and run DOS executables from a Perl script?
You mean Win2K executables presumably. DOS hasn't
been a part of Windows since 1995 except as a minor
part of the installation process.
Yes. You can run any executable, local or remote via Perl.
see perldoc -f system or perldoc Win32::Process
>2) Can I easily create a standalone program (1 file) that runs under
>DOS (command prompt) that contains my script and the Perl interpreter
>(or just what is needed for my script), so that from an end-user
>perspective it just looks like a DOS executable?
Yes. (But stop calling it DOS. There is no DOS)
Free and recommended by the experts:
The PAR module:
http://search.cpan.org/author/AUTRIJUS/PAR-0.65/PAR.pm
Commercial:
Perl2exe
http://www.indigostar.com/perl2exe.htm
PerlApp
http://activestate.com/Products/ASPN_Perl/more_information.plex
>3) Is there a preferred place to download a Perl interpreter from?
http://activestate.com/Products/ActivePerl/
--
Regards, Helgi Briem
helgi AT decode DOT is
------------------------------
Date: 13 Mar 2003 08:00:15 -0800
From: oxandrolone@hotmail.com (sean)
Subject: Re: Telnet.pm, buffering output
Message-Id: <2b051f5c.0303130800.73e1ff25@posting.google.com>
oxandrolone@hotmail.com (sean) wrote in message news:<2b051f5c.0303121255.46e680d9@posting.google.com>...
> I'm fairly green with PERL.
>
> I have a need to retrieve the output from a bunch of commands from a
> large number of Cisco routers. For some reason, which i think is due
> to buffering, i never get all the data back.
>
> Here is the snip...
>
> open(current_device, "error.log");
>
> my $telnet = new Net::Telnet ( Timeout => 10,
> # prompt => '/[\w().-]*[\$#>]\s?
> Errmode => "return"
> );
>
> snip..lots of logic for getting into the things...
>
> $ok = $telnet->cmd("set len 0");
> @shconf = $telnet->cmd(String => "show conf",Timeout => 300);
> @shver = $telnet->cmd(String => "show ver",Timeout => 300);
> @shvlan = $telnet->cmd(String => "show vlan",Timeout => 300);
> print current_device @shconf;
> print current_device @shver;
> print current_device @shvlan;
>
> close it all up and clean up.
>
> My problem is, no matter what I seem to do, all of the data never
> makes it into the file.
resolution.
$telnet->print("sho conf");
(@shoconf) = $telnet->waitfor('/^end/');
the cmd() was interpting the arguement to set prompt <device_name>. i
was setting Prompt early in the script, so cmd would see the name show
up in the stream and assume all output had been recieved. the
resolution was to use print and waitfor as shown above. the string
"end" appears on it's own line at the end of the config, so that was
my de-limiter.
------------------------------
Date: Thu, 13 Mar 2003 15:25:41 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: what is current user from .htaccess?
Message-Id: <Xns933D6A14BBF33dkwwashere@216.168.3.30>
Tore Aursand <tore@aursand.no> wrote on 12 Mar 2003:
> On Wed, 12 Mar 2003 17:29:09 -0800, Paul wrote:
>
>> On a similar note, is there a way to expire that session so that
>> they must log in again?
>
> AFAIK, no. Maybe you're able to do this by using some Apache
> module, but I don't think so; The authentication is cached in the
> client's user agent (ie. browser), so you're not able to deal with
> it from the server.
Randal Schwartz wrote a column on basic cookie management that may be
useful: http://www.stonehenge.com/merlyn/WebTechniques/col61.html
--
David K. Wall - usenet@dwall.fastmail.fm
WWJD? JWRTFM.
------------------------------
Date: Thu, 13 Mar 2003 16:06:59 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: What's wrong with the Perl docs
Message-Id: <pan.2003.03.13.14.16.21.481185@aursand.no>
On Thu, 13 Mar 2003 13:50:37 +0000, Helgi Briem wrote:
>> Foreign Language variations are unlikely to be kept up to date
> What does that mean? Unicode support finally got through in 5.8. What
> is Foreign Language variation? Perl in kanji?
Yes? :) I think he means foreign language variations of the
documentation. How can you code in Perl if you don't understand English
anyway?
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: Thu, 13 Mar 2003 15:37:53 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: What's wrong with the Perl docs
Message-Id: <3e70a52f.2951305152@news.cis.dfn.de>
On Thu, 13 Mar 2003 16:06:59 +0100, "Tore Aursand"
<tore@aursand.no> wrote:
>On Thu, 13 Mar 2003 13:50:37 +0000, Helgi Briem wrote:
>>> Foreign Language variations are unlikely to be kept up to date
>
>> What does that mean? Unicode support finally got through
>>in 5.8. What is Foreign Language variation? Perl in kanji?
>
>Yes? :) I think he means foreign language variations of the
>documentation.
Oh right. Not perl in Japanese, perldoc in Japanese.
I find that a ridiculous request/requirement. The
standard docs should be in the language the technology
is implemented in, in this case English. Local enthusiasts
can try translating the docs or writing books.
>How can you code in Perl if you don't
>understand English anyway?
Exactly.
--
Regards, Helgi Briem
helgi AT decode DOT is
------------------------------
Date: Thu, 13 Mar 2003 09:21:06 -0500
From: Tinky Winky <none@none.com>
Subject: XPATH vs Regular Expressions
Message-Id: <cm417v40enhou8ukg6itgb2oboaiin48mc@4ax.com>
I usually use 'regular expressions' to extract information from XML
tags. I just discovered that I can use XPATH interface to do the same
thing using location path like "/plist/dict/key". Is there any
advantage using one method over another ?
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4704
***************************************