[22247] in Perl-Users-Digest
Perl-Users Digest, Issue: 4468 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 26 14:05:55 2003
Date: Sun, 26 Jan 2003 11:05:07 -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 Sun, 26 Jan 2003 Volume: 10 Number: 4468
Today's topics:
Re: @$x array scalar question Andrew Lee
Re: @$x array scalar question <tassilo.parseval@post.rwth-aachen.de>
Re: @$x array scalar question (Tad McClellan)
can i drop into the debugger programmatically? <throwaway@mit.edu>
chainging @INC path <steve.connet@USENETcox.net>
Re: chainging @INC path <eric.ehlers@btopenworld.com.nospam>
Re: Changing the context of a code block <eric.anderson@cordata.net>
Re: Changing the context of a code block <uri@stemsystems.com>
Re: commenting out code <abigail@abigail.nl>
How to make standalone perlscript <t18_pilot@hotmail.spam.com>
Re: How to make standalone perlscript (Ben Morrow)
Re: How to make standalone perlscript (h\)
Net::FTP Win2K server probs <rogerm@DONTEVENTHINKOFSPAMMINGducati.demon.co.uk>
Net::Telnet - 'unknown terminal type network' error (James Willmore)
New make.pl version 0.3 released <occitan@esperanto.org>
Re: Perl script to access directory <alex@alexbanks.com>
Possible dead links in perlfaq <comdog@panix.com>
Problems with CGI::Session <patrick.stiefel@tu-clausthal.de>
Re: Problems with CGI::Session <spam@thecouch.homeip.net>
Re: Split question <eric.ehlers@btopenworld.com.nospam>
Thanx all! (ilbeduino)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 26 Jan 2003 03:43:47 -0500
From: Andrew Lee
Subject: Re: @$x array scalar question
Message-Id: <1n673v0mca2tpilgdh5p1t3qhcppch6lgq@4ax.com>
On 25 Jan 2003 03:30:51 -0800, java_dev_train@yahoo.com (java_dev_train)
wrote:
>I understand @a is an array.
>I understand $b is a scalar.
>
>I came across this PERL syntax - @$x.
>
>I found the following code on http://perlcircus.com/site/scalars.html
>
>$sca = ["Sue", "Black", "29"];
>print @$sca[0];
>print $sca->[1];
>
>What is the advantage of the @$sca syntax?
There is no advantage and it tends to be confusing. As other posters
have explained $sca is an array reference and $$sca[0], $sca->[0] are
array elements retrieved through a reference. @$sca[0] is an array
slice of a single element (via reference). Array slices are, IMHO, only
interesting if you are looking for several elements of an array and
ought not be used to retrieve a single element.
Example :
my $sca = ["Sue", "Black", "29"];
print $sca->[0]; # prints Sue
print join ":", @$sca[0,2];
# prints Sue:29, this is an array slice
print join ":", @$sca;
# prints Sue:Black:29 -- the entire array (elements joined with ':')
print @$sca[0];
# prints Sue -- but in the most inefficient way possible
__END__
>I do not understand the usefulness
>of this syntax, it seems it would have been intuitive to assign the 3 element
>list to an array rather than the scalar variable $sca.
The reference is fast and useful and worth learning about.
Dereferencing references tends to trip up people who are less
experienced with this essential feature of Perl. perldoc perlref and
perldoc perllol are excellent sources for more info.
HTH
------------------------------
Date: 26 Jan 2003 09:29:47 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: @$x array scalar question
Message-Id: <b109qb$l8c$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Andrew Lee:
> On 25 Jan 2003 03:30:51 -0800, java_dev_train@yahoo.com (java_dev_train)
> wrote:
>
>>I understand @a is an array.
>>I understand $b is a scalar.
>>
>>I came across this PERL syntax - @$x.
>>
>>I found the following code on http://perlcircus.com/site/scalars.html
>>
>>$sca = ["Sue", "Black", "29"];
>>print @$sca[0];
>>print $sca->[1];
>>
>>What is the advantage of the @$sca syntax?
>
> There is no advantage and it tends to be confusing. As other posters
> have explained $sca is an array reference and $$sca[0], $sca->[0] are
> array elements retrieved through a reference. @$sca[0] is an array
> slice of a single element (via reference). Array slices are, IMHO, only
> interesting if you are looking for several elements of an array and
> ought not be used to retrieve a single element.
>
> Example :
>
> my $sca = ["Sue", "Black", "29"];
> print $sca->[0]; # prints Sue
> print join ":", @$sca[0,2];
> # prints Sue:29, this is an array slice
> print join ":", @$sca;
> # prints Sue:Black:29 -- the entire array (elements joined with ':')
> print @$sca[0];
> # prints Sue -- but in the most inefficient way possible
And there are even moments, when using a one-element slice is simply
wrong because of context. Consider you want to read one line from a
handle:
@$sca[0] = <HANDLE>;
After that <HANDLE> has reached EOF.
So people writing '@arr[$n]' should be told that it's more than just a
cosmetical difference.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Sun, 26 Jan 2003 08:22:58 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: @$x array scalar question
Message-Id: <slrnb37rq2.t17.tadmc@magna.augustmail.com>
Andrew Lee <AndrewLee> wrote:
> On 25 Jan 2003 03:30:51 -0800, java_dev_train@yahoo.com (java_dev_train)
> wrote:
>>I came across this PERL syntax - @$x.
> perldoc perlref and
> perldoc perllol are excellent sources for more info.
And before reading those, see the references tutorial:
perldoc perlreftut
After reading those, see the data structures cookbook:
perldoc perldsc
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Jan 2003 12:10:38 -0500
From: Alex Coventry <throwaway@mit.edu>
Subject: can i drop into the debugger programmatically?
Message-Id: <87k7grn8fl.fsf@mit.edu>
hi. does perl have a cognate of python's pdb.set_trace? in python,
calling this function drops you into the debugger in the context at
which it was called.
alex.
------------------------------
Date: Sun, 26 Jan 2003 16:22:43 GMT
From: "Outlaw X" <steve.connet@USENETcox.net>
Subject: chainging @INC path
Message-Id: <nXTY9.21721$QV3.2780881@news2.west.cox.net>
I seem to have perl in the following places:
/usr/lib/perl5/5.6.0
/usr/local/lib/perl/5.6.1
'which perl' reveals it is using the one in: /usr/local/bin/perl which is
version 5.6.1.
When I install some perl programs (linksysmon), it gives me the following
error when I run it:
Can't locate linksysmon.pm in @INC (@INC contains:
/usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl .) at /usr/sbin/linksysmon line 24.
Why does the @INC path look in 5.6.0? How do I tell it to look in the 5.6.1
directory? Or do I have something completely hosed up here?
--
OutlawX
------------------------------
Date: Sun, 26 Jan 2003 17:57:28 +0000 (UTC)
From: "eric" <eric.ehlers@btopenworld.com.nospam>
Subject: Re: chainging @INC path
Message-Id: <b117i8$s4a$1@venus.btinternet.com>
"Outlaw X" <steve.connet@USENETcox.net> wrote in message
news:nXTY9.21721$QV3.2780881@news2.west.cox.net...
> I seem to have perl in the following places:
>
> /usr/lib/perl5/5.6.0
> /usr/local/lib/perl/5.6.1
>
> 'which perl' reveals it is using the one in: /usr/local/bin/perl which is
> version 5.6.1.
>
> When I install some perl programs (linksysmon), it gives me the following
> error when I run it:
>
> Can't locate linksysmon.pm in @INC (@INC contains:
> /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
> /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
> /usr/lib/perl5/site_perl .) at /usr/sbin/linksysmon line 24.
>
> Why does the @INC path look in 5.6.0? How do I tell it to look in the
5.6.1
> directory? Or do I have something completely hosed up here?
>
> --
> OutlawX
the "which perl" command is simply telling you that /usr/local/bin/perl is
the first (or only) perl to appear in your $PATH variable. the script
you're running may be picking up a different perl binary, for example with
the following line at the top:
#!/path/to/other/perl
the value of @INC is hard-wired into the perl binary when perl itself is
compiled. it's possible that the script is picking up a 5.6.1 binary which
was compiled to use the 5.6.0 library paths.
i suggest you identify which perl binaries are installed on your system,
then for each one, establish its version and @INC by typing the following at
the command line -
/path/to/perl -V
once you decide which binary you want to use, you'll want to put the path to
that binary at the top of your script. then you need to ensure that the
chosen binary has access to linksysmon.pm. if linksysmon.pm does not appear
in the @INC path for your chosen perl binary, you'll need to tell perl where
to find it, for example with the use lib pragma. the top of your script
might look like this:
#!/path/to/chosen/perl
use lib 'path/to/linksysmon';
use linksysmon;
-eric
------------------------------
Date: Sun, 26 Jan 2003 11:03:31 -0500
From: "Eric Anderson" <eric.anderson@cordata.net>
Subject: Re: Changing the context of a code block
Message-Id: <pan.2003.01.26.16.03.28.777249@cordata.net>
On Sun, 26 Jan 2003 04:21:32 +0000, Uri Guttman wrote:
> that makes little sense. you still haven't given a big picture and a
> reason why you want it. manipulating an object definition can be easy or
> hard depending on the manipulation needed. so you have to be much more
> specific and give the proper picture. your internal understanding is
> useless to others without properly communicated requirements.
The manipulation I want to do is fairly simple. I want a interface that
allows me to specify object names, their attributes, and their methods.
Then my interface will mess with the symbol table to create an object as
specified.
> EA> This is part of a larger project that I am working on. I'm still EA>
> trying to develop the basic idea of what I want to do, so it is EA> part
> experimentation. Therefore their is a good change I have an EA> XY
> problem, but until I understand for myself what I want to EA> accomplish
> a bit more I won't really know. You could kind of look EA> at this as a
> prototype so that I can see if what I am thinking EA> will really
> satisfy my needs.
>
> that isn't a good idea. playing with what works and doesn't is not the way
> to clarify a fuzzy specification. just because you can do something
> doesn't mean it is something you should do or it is the best way to do it.
> that is the whole XY problem. you think Y is the solution and you want
> help with it but you never told us what the original X problem is. you
> still haven't told us X.
But the only way I can evaluate if it does what I needs is to implement it
(even if it isn't the best possible way) to see if it really does satisfy
my needs. I think it will satisfy my needs, but until I can start
developing with what I am creating I will not really know for sure.
I don't mean to be obscure about what I am trying to do. It is just that
it would take a bit to explain what I am trying to do. Also the bigger
picture of what I am trying to do is not very relevent to my original
question. My original question is really just an implementation issue. The
requirements of my project for this implementation detail is that I want
to be able to define a object at runtime and it behave exactly like it
would if it was defined statically at compile time. I also want to have an
interface to this so that the parts of my code that are actually defining
the objects don't have to deal with manipulating the symbol table. They
just specify what they want.
I have something that is close to what I want, except that it doesn't
behave exactly the same as if it was defined statically. Where it differs
is when I use the caller() function (or __PACKAGE__ symbol). If a function
trys to figure out what package it is part of (or a function that it calls
it does), then it returns the package name where it was defined, not the
package that it is installed in. I understand why it does this I am just
trying to figure out a way to make it behave differently.
> EA> So my current issue is that I want to be able to have some code EA>
> pass me a code block, and then my function will define that code EA>
> block in the context of the specified package. I want it to work EA> the
> exact same as if the code had actually been defined in a file EA> that
> defines that package.
>
> so, that is just installing a code ref into a package's symbol table.
> nothing more. your strange package code had nothing to do with that. you
> don't need the package command to do this.
As stated above the connection between the code posted and what I am
trying to do is that I cannot define a function dynamically into a package
and have it behave exactly like it does as if it was defined statically in
that package. The caller() function and __PACKAGE__ symbol behave
differently.
Is there any want to convert a code block into a string? For example:
my $func = sub {
print "Blah\n";
}
print block_to_string( $func );
[....would output....]
print "Blah\n";
In the above example block_to_string would convert the code block to a
string.
--
Eric Anderson
------------------------------
Date: Sun, 26 Jan 2003 18:42:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Changing the context of a code block
Message-Id: <x74r7viwgr.fsf@mail.sysarch.com>
>>>>> "EA" == Eric Anderson <eric.anderson@cordata.net> writes:
EA> On Sun, 26 Jan 2003 04:21:32 +0000, Uri Guttman wrote:
>> that makes little sense. you still haven't given a big picture and a
>> reason why you want it. manipulating an object definition can be easy or
>> hard depending on the manipulation needed. so you have to be much more
>> specific and give the proper picture. your internal understanding is
>> useless to others without properly communicated requirements.
EA> The manipulation I want to do is fairly simple. I want a interface
EA> that allows me to specify object names, their attributes, and
EA> their methods. Then my interface will mess with the symbol table
EA> to create an object as specified.
objects don't have names. objects don't live in symbols tables. you can
create classes on the fly and bless objects into them. given what you
say there i think you still have an XY problem. you are specifying a
design need but not a requirements spec. why do you need to design such
on the fly things? there are many ways to do it. look at
class::classless for one. each object has its own unique class and can
be created anytime.
EA> But the only way I can evaluate if it does what I needs is to
EA> implement it (even if it isn't the best possible way) to see if it
EA> really does satisfy my needs. I think it will satisfy my needs,
EA> but until I can start developing with what I am creating I will
EA> not really know for sure.
that isn't a way to design something. you can't just code up multiple
answers to a problem and just see if they work. you still haven't
specified a proper requirement which state the desired result and not
some implementation. you have to learn the difference between
requirements and design. your writing here shows that you conflate the
two but they are very different.
EA> I don't mean to be obscure about what I am trying to do. It is
EA> just that it would take a bit to explain what I am trying to
EA> do. Also the bigger picture of what I am trying to do is not very
EA> relevent to my original question. My original question is really
EA> just an implementation issue. The requirements of my project for
EA> this implementation detail is that I want to be able to define a
EA> object at runtime and it behave exactly like it would if it was
EA> defined statically at compile time. I also want to have an
EA> interface to this so that the parts of my code that are actually
EA> defining the objects don't have to deal with manipulating the
EA> symbol table. They just specify what they want.
then you still have an XY problem. you are seeking implementation
answers to a problem that can probably be solved in a very different
way. i can't help with only the meager info you are giving out.
EA> I have something that is close to what I want, except that it
EA> doesn't behave exactly the same as if it was defined
EA> statically. Where it differs is when I use the caller() function
EA> (or __PACKAGE__ symbol). If a function trys to figure out what
EA> package it is part of (or a function that it calls it does), then
EA> it returns the package name where it was defined, not the package
EA> that it is installed in. I understand why it does this I am just
EA> trying to figure out a way to make it behave differently.
you are definitely going down the wrong path there. i have seen many OO
designs and done many and never have i seen that requirement. classes
know their classes or can be told that with closures but not
staticly.
EA> As stated above the connection between the code posted and what I
EA> am trying to do is that I cannot define a function dynamically
EA> into a package and have it behave exactly like it does as if it
EA> was defined statically in that package. The caller() function and
EA> __PACKAGE__ symbol behave differently.
i reiterate that your design direction is flawed. if you want such a
beast, then you have a poor architecture and you have to rethink it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
Date: 26 Jan 2003 16:18:52 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: commenting out code
Message-Id: <slrnb382jc.tfm.abigail@alexandra.abigail.nl>
mfield (mfield@ernie.botany.ubc.ca) wrote on MMMCDXXXII September
MCMXCIII in <URL:news:3E306A1D.BB777F53@ernie.botany.ubc.ca>:
@@ I was wondering if there is an easy way to comment out large sections of
@@ code in perl (using emacs) without commenting out the lines
@@ individually. Thanks in advance
<<m=~m>>
Use the secret operator on the previous line.
Put your comments here.
Lots and lots of comments.
You can even use blank lines.
Finish with a single
m
;
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
------------------------------
Date: Sun, 26 Jan 2003 14:07:12 GMT
From: "William Hymen" <t18_pilot@hotmail.spam.com>
Subject: How to make standalone perlscript
Message-Id: <kYRY9.4329$U27.403538@newsread2.prod.itd.earthlink.net>
I need to distribute a standalone perlscript
"tarfile.pl" in my company. It bundles a directory
tree into a tarfile. I do not want to run around and
install Perl or the GNU toolset everywhere.
I only want to give people these (4) things:
someones perl.exe;
someones tar.exe;
my tarfile.pl
install (file copy) instructions;
The problem here is I need the following
package:
use Cwd qw(chdir getcwd abs_path);
I need to use
chdir , getcwd , opendir
How can I include these packages into my script as
a callable function ?
Thanks in advance -
Bill
------------------------------
Date: Sun, 26 Jan 2003 15:09:52 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: How to make standalone perlscript
Message-Id: <b10to0$nsb$1@wisteria.csv.warwick.ac.uk>
"William Hymen" <t18_pilot@hotmail.spam.com> wrote:
>I need to distribute a standalone perlscript
>"tarfile.pl" in my company. It bundles a directory
>tree into a tarfile. I do not want to run around and
>install Perl or the GNU toolset everywhere.
>I only want to give people these (4) things:
>
>someones perl.exe;
>someones tar.exe;
>my tarfile.pl
>install (file copy) instructions;
>
>The problem here is I need the following
>package:
>use Cwd qw(chdir getcwd abs_path);
>I need to use
>chdir , getcwd , opendir
>
>How can I include these packages into my script as
>a callable function ?
You can copy the contents of Cwd.pm into the top of your script, and remove
the use Cwd; line. You can also use Archive::Tar to do the tarring. You may
need to install more than just perl.exe: I suspect you'll need perl56.dll or
some such unless you build perl yourself staticly.
Ben
------------------------------
Date: Sun, 26 Jan 2003 19:50:05 +0100
From: "Michael Peuser \(h\)" <post@mpeuser.de>
Subject: Re: How to make standalone perlscript
Message-Id: <b11aj3$64e$02$1@news.t-online.com>
"Ben Morrow" <mauzo@mimosa.csv.warwick.ac.uk> schrieb im Newsbeitrag
news:b10to0$nsb$1@wisteria.csv.warwick.ac.uk...
> "William Hymen" <t18_pilot@hotmail.spam.com> wrote:
> >I need to distribute a standalone perlscript
> >"tarfile.pl" in my company. It bundles a directory
> >tree into a tarfile. I do not want to run around and
> >install Perl or the GNU toolset everywhere.
> >I only want to give people these (4) things:
> >
> >someones perl.exe;
> >someones tar.exe;
> >my tarfile.pl
> >install (file copy) instructions;
> >
> >The problem here is I need the following
> >package:
> >use Cwd qw(chdir getcwd abs_path);
> >I need to use
> >chdir , getcwd , opendir
> >
> >How can I include these packages into my script as
> >a callable function ?
>
> You can copy the contents of Cwd.pm into the top of your script, and
remove
> the use Cwd; line. You can also use Archive::Tar to do the tarring. You
may
> need to install more than just perl.exe: I suspect you'll need perl56.dll
or
> some such unless you build perl yourself staticly.
>
If you are willing to spend money look at:
- www.activestate.com for PerlApp
- www.indigostar.com for Perl3Exe
Kindly Mike
------------------------------
Date: Sun, 26 Jan 2003 12:16:31 +0000 (UTC)
From: "Roger" <rogerm@DONTEVENTHINKOFSPAMMINGducati.demon.co.uk>
Subject: Net::FTP Win2K server probs
Message-Id: <b10jiv$52d$1@helle.btinternet.com>
Hi all
Hope this is an appropriate forum for my query. I posted this over on
comp.lang.perl.modules a couple of days ago and after no responses I thought
I'd try it on here. I apologise in advance for the loose connection with
Perl but I am as yet unclear as to whether my problem is an activestate perl
issue, module issue, software design issue, OS issue or other. I'm just
hoping that a perl guru on here may have come across the problem before and
know what the solution is ...
I have a small perl script that automates the download of several thousand
small files each day from a server. Because the ftp session sometimes hangs,
this script is launched and controlled by another perl script that is a
scheduled task on an IIS server. This "launcher" uses Win32::Process to
launch the download script and monitor its progress. If it seems to have not
done anything for 20 seconds, it kills the process and starts again.
The launcher and download script all "seem" to work fine - in that they do
what they were designed to do and can run for days without incident. BUT
they are causing a port problem on the
server they are running on whereby the server seems to run out of available
ports and the web server cannot establish many simultaneous connections when
the perl scripts are running.
I'm at a bit of a loss as to why. The download script opens a single ftp
session and then sequentially downloads the files using;
$rc=$ftp->get($filename,$nowpath.$filename);
The return code is checked so that a SQL database of what has and has not
been downloaded during this session can be tracked. This allows the files
missed to be picked up at another time.
Is there something I'm doing wrong? Is this a server configuration issue
that's beyond the scope of this group? (Win2K / IIS 5.0).
I'd be most grateful for any pointers in the right direction, I've had a
good hunt around on the web for a solution but maybe I haven't been
expressing the question correctly as I can't find any references to it so
far...
Thanks in advance for any help
Roger
West Yorkshire
UK
PS. Environment is ActiveState Perl 5.8, Intel based Win2K server with 1GB
of RAM, IIS5.0.
------------------------------
Date: 26 Jan 2003 10:50:53 -0800
From: jwillmore@cyberia.com (James Willmore)
Subject: Net::Telnet - 'unknown terminal type network' error
Message-Id: <e0160815.0301261050.7b29bb95@posting.google.com>
While using Net::Telnet, I got the following message in my input log:
====BEGIN LOG=================
AUTHORIZED USE ONLY
maxine login: jim
Password:
You have new mail in /var/mail/jim.
Last login: Sun Jan 26 13:25:47 from localhost
CONNECTIONS ARE LOGGED AND MONITORED
tset: unknown terminal type network
Terminal type?
====END LOG==================
It's a simple script. I commented out some of the lines -- because
the script never got that far and I wanted to rule out the a typical
'waitfor' issues that many have posted here. It seems to me that I
need to do something more in order to connect. I never had to before,
so I'm at a loss. And you can see that I tried to define the TERM
type.
I did upgrade to 5.8, but I don't see how that might affect this
script. And I reinstalled the daemon, because I thought that maybe,
just maybe, someone penetrated my system and trojaned it. This
doesn't seem to be the case. Same reults after reinstall.
So, if anyone could help ......
And this is the script:
==================
#!/usr/bin/perl -w
use strict;
die "$0 usage: <username> <password> <server>\n"
unless(@ARGV == 3);
$ENV{TERM} = 'vt220';
print "$ENV{TERM}\n";
use Net::Telnet;
use vars qw/$server $username $password @results/;
$username = $ARGV[0];
$password = $ARGV[1];
$server = $ARGV[2];
my $telnet = new Net::Telnet(
Timeout=>5,
Host=>$server
);
$telnet->input_log('./in.log');
$telnet->output_log('./out.log');
$telnet->login($username, $password);
#@results = $telnet->cmd("cd ;ls");
#$telnet->waitfor("/$server/");
$telnet->close;
print @results;
exit;
------------------------------
Date: Sun, 26 Jan 2003 09:27:21 +0100
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: New make.pl version 0.3 released
Message-Id: <3e340ae5$1_7@news.teranews.com>
Hi all!
Here again comes a make in everybody's favourite programming language, Perl,
giving you the best of both worlds. You can use it to write a plain
makefile, though in Perl syntax. Or, at the other extreme, you can write a
program, that among others does a few (file-) depency driven things.
- Made rule resolution work, and actually use it productively
- New deferred variable type once
- Replaced ignore by keep_going, matching command line option
- Completed and added new autoloadable builtin commands (fsort, head, pod2usage, rev, tail, template)
- Fixed links in POD
- Also available on CPAN <http://www.cpan.org/scripts/>
http://dapfy.bei.t-online.de/make.pl/
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
-- GPL 3: take the wind out of Palladium's sails! --
------
-- My other stuff here too, sawfish, make.pl...: --
------
-- http://dapfy.bei.t-online.de/ --
------------------------------
Date: Sun, 26 Jan 2003 12:26:21 -0000
From: "Alex Banks" <alex@alexbanks.com>
Subject: Re: Perl script to access directory
Message-Id: <3e33d3f3$0$227$cc9e4d1f@news.dial.pipex.com>
> Then you should read the posting guidelines for this group.
>
> and read through http://www.cs.tut.fi/~jkorpela/usenet/xpost.html
>
Tis done. No more top posts. No more cross posts.
------------------------------
Date: Sun, 26 Jan 2003 11:58:20 -0600
From: brian d foy <comdog@panix.com>
Subject: Possible dead links in perlfaq
Message-Id: <260120031158202249%comdog@panix.com>
[also posted to documentation@perl.org, perlfaq-workers@perl.org]
thes links have failed a couple of times this week. anyone know where
these might have moved to?
------------------------------------------------------------------------
FAILURE REPORT
------------------------------------------------------------------------
======perlfaq3.pod
http://alpha.olm.net/
http://www.MultiEdit.com/
http://www.binevolve.com/
--
brian d foy, comdog@panix.com
------------------------------
Date: Sun, 26 Jan 2003 11:05:58 +0100
From: "Patrick Stiefel" <patrick.stiefel@tu-clausthal.de>
Subject: Problems with CGI::Session
Message-Id: <b10bud$188i$1@ariadne.rz.tu-clausthal.de>
Hi,
i have a question unsing module CGI::Session.
I use 2 sessions to simulate a variable transport from one document to any
other.
First I create a new session, later i use the session id to create a new
session based on the first one.
Then I try to read the variable "f_name" in both sessions.
The result of the first is ok, but there are problems with the second which
should also include my variable "f_name" or not ?
Or is there something wrong in my code impletented ?
Thanks for helping me.
Patrick.
----------------------------------------------------------------------------
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use CGI::Session;
use CGI::Session::File;
$Session = new CGI::Session(undef, undef, {Directory=>'/tmp'});
$Session->param(-name=>'f_name', -value=>"Hallo Session");
$sid = $Session->id();
$Session2 = new CGI::Session(undef, $sid, {Directory=>'/tmp'});
# HTML-Seite erstellen
print "Content-Type: text/html\n\n";
print "<html><head>\n<meta http-equiv=\"Content-type\" content=\"text/html;
charset=utf-8\">\n";
print "<link rel=\"stylesheet\" href=\"../../styles/mystyle.css\"
type=\"text/css\">\n";
print "</head>\n<body>\n";
$f_name = $Session->param('f_name');
$f_neu = $Session2->param('f_name');
print $f_name;
print $f_neu;
print"</body></html>";
------------------------------
Date: Sun, 26 Jan 2003 11:58:39 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: Problems with CGI::Session
Message-Id: <4tUY9.4522$G61.33983@weber.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Patrick Stiefel wrote:
| Hi,
| [SNIP]
|
| ----------------------------------------------------------------------------
| #!/usr/bin/perl
|
| use CGI::Carp qw(fatalsToBrowser);
| use CGI::Session;
| use CGI::Session::File;
|
| $Session = new CGI::Session(undef, undef, {Directory=>'/tmp'});
| $Session->param(-name=>'f_name', -value=>"Hallo Session");
| $sid = $Session->id();
I have not tested your code, but at this point, $Session is still an object in
memory. It has not (yet) been serialized to disk.
|
| $Session2 = new CGI::Session(undef, $sid, {Directory=>'/tmp'});
You're telling it to load $sid from disk, which does not exist.
|
| # HTML-Seite erstellen
| print "Content-Type: text/html\n\n";
| print "<html><head>\n<meta http-equiv=\"Content-type\" content=\"text/html;
| charset=utf-8\">\n";
| print "<link rel=\"stylesheet\" href=\"../../styles/mystyle.css\"
| type=\"text/css\">\n";
| print "</head>\n<body>\n";
|
| $f_name = $Session->param('f_name');
| $f_neu = $Session2->param('f_name');
|
| print $f_name;
| print $f_neu;
| print"</body></html>";
I don't know what happens when 2 sessions attempt to write to disk using the
same session ID. You might run into problems with data integrity here.
CGI::Session objects automatically serialize to disk as they go out of scope,
or when the ->close() method is called, or when the program ends, or: You may
also force a disk write with the ->flush() method.
However, eventhough there may be a work around-around by flushing first, I
highly recommend against having two concurrent session objects with the same
session id. You'd just be asking for trouble at commit time.
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+NBO/eS99pGMif6wRAtZdAKC7Rt2uPABvc8xFUC+kMFTMBFPmXgCfdD5X
OeLjVjtMoP9Av9Vn5lYOxa8=
=X85L
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 26 Jan 2003 17:07:04 +0000 (UTC)
From: "eric" <eric.ehlers@btopenworld.com.nospam>
Subject: Re: Split question
Message-Id: <b114jo$qpb$1@helle.btinternet.com>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:SNoY9.265$Ec.129@nwrddc02.gnilink.net...
> Thomas Brooks wrote:
> > I am doing some splitting in perl
> > --------------------------------------
>
> What the F**** ?
> I just answered your very same question in the other NG.
> Would you please stop multi-posting?
>
> jue
what the F*** does F**** stand for? also that's a very un-Perlish use of *.
here in c.l.p.m, i'd write that as
/[fF].{3}/
-eric
------------------------------
Date: 26 Jan 2003 02:55:26 -0800
From: giulio@forteyang.com (ilbeduino)
Subject: Thanx all!
Message-Id: <203a632d.0301260255.60768fdb@posting.google.com>
Thank you Anno, thank you Mike.
Probabily it was my first time in comparing floating
numbers! We have eurocents only sice one year! Before
that time, I realized now, I used always integer numbers
in my scripts! :-)
I will take care about it!
Aloa
------------------------------
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 4468
***************************************