[17328] in Perl-Users-Digest
Perl-Users Digest, Issue: 4750 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 28 14:10:26 2000
Date: Sat, 28 Oct 2000 11:10:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972756610-v9-i4750@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 28 Oct 2000 Volume: 9 Number: 4750
Today's topics:
okay i tried ftp but... i dont get it. <yilias@hotmail.com>
Re: okay i tried ftp but... i dont get it. (Clay Irving)
perl/cgi programmer in Atlanta <ultrak@my-deja.com>
Perl: ICQ Checker <teemu.oksanen@luukku.com>
Re: Perl: ICQ Checker (Gwyn Judd)
Re: Perl: ICQ Checker <teemu.oksanen@luukku.com>
Re: redirecting output changes order? <ren.maddox@tivoli.com>
Re: stat / inode question <elaine@chaos.wustl.edu>
Re: Text area on a form with Perl CGI script <james@NOSPAM.demon.co.uk>
Unpack tamplate <aurelio@b-soft.com>
Unpack tamplate <aurelio@b-soft.com>
Re: Unpack tamplate <james@NOSPAM.demon.co.uk>
Re: use strict; with eval:: error messages to stderr <bbrown@addtoit.com>
Re: what does /warn "$x" if "$x"/ mean (Martien Verbruggen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 28 Oct 2000 13:09:41 GMT
From: "ronald" <yilias@hotmail.com>
Subject: okay i tried ftp but... i dont get it.
Message-Id: <peAK5.2546$iF1.34767@typhoon.bart.nl>
OKay i'm a real newbie in this part, so i hope someone could help me.
I found the site about het net::ftp module, but... where can i get it, how
do i install it and how do i huse it.
There arent any tutorials about this subject so i hope someone here could
help me.
greez
Ronald
------------------------------
Date: 28 Oct 2000 15:34:44 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: okay i tried ftp but... i dont get it.
Message-Id: <slrn8vlsgf.cg.clay@panix3.panix.com>
On Sat, 28 Oct 2000 13:09:41 GMT, ronald <yilias@hotmail.com> wrote:
>OKay i'm a real newbie in this part, so i hope someone could help me.
>I found the site about het net::ftp module, but... where can i get it, how
>do i install it and how do i huse it.
>There arent any tutorials about this subject so i hope someone here could
>help me.
Net::FTP is part of the libnet bundle.
At a command line, type:
perl -MCPAN -e shell
At the CPAN shell prompt, type:
i /Net::FTP/
You'll eventually see:
Module Net::FTP (G/GB/GBARR/libnet-1.0703.tar.gz)
Module Net::FTP::A (G/GB/GBARR/libnet-1.0703.tar.gz)
Module Net::FTP::Common (T/TB/TBONE/Net-FTP-Common-1.2.tar.gz)
Module Net::FTP::E (G/GB/GBARR/libnet-1.0703.tar.gz)
Module Net::FTP::I (G/GB/GBARR/libnet-1.0703.tar.gz)
Module Net::FTP::L (G/GB/GBARR/libnet-1.0703.tar.gz)
Module Net::FTP::Shell (T/TB/TBONE/Net-FTP-Shell-1.2.tar.gz)
Module Net::FTP::dataconn (G/GB/GBARR/libnet-1.0703.tar.gz)
Module Net::FTPServer (R/RW/RWMJ/Net-FTPServer-0.5.1.tar.gz)
Module Net::FTPServer::DirHandle (R/RW/RWMJ/Net-FTPServer-0.5.1.tar.gz)
Module Net::FTPServer::FileHandle (R/RW/RWMJ/Net-FTPServer-0.5.1.tar.gz)
Module Net::FTPServer::Handle (R/RW/RWMJ/Net-FTPServer-0.5.1.tar.gz)
At the CPAN shell prompt, type:
install /Bundle::libnet/
--
Clay Irving <clay@panix.com>
It is always the best policy to tell the truth, unless, of course, you are
an exceptionally good liar.
- Jerome K. Jerome
------------------------------
Date: Sat, 28 Oct 2000 15:55:26 GMT
From: Kermit Lowry, III <ultrak@my-deja.com>
Subject: perl/cgi programmer in Atlanta
Message-Id: <8testc$q34$1@nnrp1.deja.com>
looking for a perl/cgi programmer with 2+yrs with cgi on Win & Linux.
$25-30/hr contract
Please email me at :
reverse moc.tratsxunil@namretupmoc
-- Computerman
----------------
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 28 Oct 2000 10:51:53 GMT
From: "Teemu Oksanen" <teemu.oksanen@luukku.com>
Subject: Perl: ICQ Checker
Message-Id: <ddyK5.60$M86.2525@read2.inet.fi>
Hi!
If you have perl script called "ICQ Checker", please, could you e-mail it to
my! If could, I'll be very thankful!
--
Teemu Oksanen
teemu@partio.net
http://www.partio.net/~teemu/
------------------------------
Date: Sat, 28 Oct 2000 14:23:34 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Perl: ICQ Checker
Message-Id: <slrn8vlob2.vkh.tjla@thislove.dyndns.org>
I was shocked! How could Teemu Oksanen <teemu.oksanen@luukku.com>
say such a terrible thing:
>Hi!
>If you have perl script called "ICQ Checker", please, could you e-mail it to
>my! If could, I'll be very thankful!
Here:
#!/usr/bin/perl -w0
print "${\(($_=<>)=~y=ICQ=QIC=)}";
Now just save this script to a file called "ICQ Checker.pl" and run it.
I hope that helps.
--
Gwyn "Next I'm working on DeCSS" Judd
(print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Kerr's Three Rules for a Successful College:
Have plenty of football for the alumni, sex for the students,
and parking for the faculty.
------------------------------
Date: Sat, 28 Oct 2000 16:21:15 GMT
From: "Teemu Oksanen" <teemu.oksanen@luukku.com>
Subject: Re: Perl: ICQ Checker
Message-Id: <%1DK5.173$M86.6157@read2.inet.fi>
> #!/usr/bin/perl -w0
> print "${\(($_=<>)=~y=ICQ=QIC=)}";
Sorry, but what this should do???
I meant a script which check, if (for example) ICQ-user #9428573 is online.
If he is, then the script prints "online". If he isn't, then it prints
"offline".
-Teemu
------------------------------
Date: 27 Oct 2000 21:54:16 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: redirecting output changes order?
Message-Id: <m3vgudptev.fsf@dhcp11-177.support.tivoli.com>
Bob Walton <bwalton@rochester.rr.com> writes:
> innocent_smith@my-deja.com wrote:
> >
> > I'm really confused by this. Why does directing
> > the output to a file change the order?
> >
> > milprod:/tmp # cat systest.pl
> > #!/usr/bin/perl
> > print "line1\n";
> > system "echo line2";
> > milprod:/tmp # ./systest.pl
> > line1
> > line2
> > milprod:/tmp # ./systest.pl > x
> > milprod:/tmp # cat x
> > line2
> > line1
> > milprod:/tmp #
>
> You need to look up the $| variable, which turns file buffering off for
> the selected filehandle.
>
> perldoc perlvar
> perldoc -f select
>
> Basically, your print statements are putting characters in an internal
> buffer, and actual I/O operations happen only every once in a while
> (like when 8K characters are accumulated). When you switch from your
> Perl program to another program, the other program will run and write
> out the contents of its buffered I/O operations when it terminates --
> and meanwhile, Perl's output is still pending in the bugger. Setting $|
> nonzero while a given filehandle is selected will set that filehandle so
> that every print statement causes an actual physical I/O operation, and
> buffering is not used. This is referred to as setting autoflush on.
And the other side of this coin is that output to the terminal is
normally line-buffered, so the newline forces a flush, which is why it
works normally and you only run into the problem when redirecting.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Sat, 28 Oct 2000 13:49:24 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: stat / inode question
Message-Id: <B62051AB.8C05%elaine@chaos.wustl.edu>
in article 39fa2a0c.2d7c$25@news.op.net, Mark-Jason Dominus at
mjd@plover.com quoth:
> Maybe the Good Advice file should also include something like this:
>
> #11965 There are more things in heaven and earth, Horatio,
> Than are dreamt of in your philosophy.
I was going to suggest 'Needless pedantry is bad for the bloodpressure'.
e.
------------------------------
Date: Sat, 28 Oct 2000 11:10:02 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Text area on a form with Perl CGI script
Message-Id: <ant28100206cfNdQ@oakseed.demon.co.uk>
In article <dEsK5.8830$UL.535735@bgtnsc07-news.ops.worldnet.att.net>,
Daniel Murphy <URL:mailto:danmurph@worldnet.att.net> wrote:
>
> Netscape - An error box says "Document contains no data."
> Explorer - The end of the URL has the name of the CGI script and
> the browser window is blank.
This error is due to sending a Content-type: text/html header
without any following content. If you really want to send nothing
to the browser so that it continues to display the same page,
you could instead send the header Status: 204 No response
However, doing this means that the browser user gets no feedback
to show that they actually clicked on the Submit button and so they
may try to do so several times and then give up thinking it didn't
work. It would therefore be better to return a new page confirming
receipt with if necessary a <textarea> containing the text in
question.
> I want the original web page with the text area to remain in the
> browser display when clicking on Submit. Or, can I have the browser
> return to the previous page?
Getting the browser to load another page would be done by sending
a Location: ...url... by itself.
> Also, the wrap feature works OK in the text area window, but
> the same wrapping "newlines" do not appear in the text file.
> Will I need to add something to the CGI to handle that?
The behaviour of wrapping is browser dependent so the short answer
is yes you will and you should. Some browsers support the non-standard
WRAP attribute for a textarea which can take values like NONE, VIRTUAL,
and PHYSICAL, but you shouldn't rely on it unless you know for sure
that all users of your CGI app will be using a browser that supports
this.
> Thanks.
No probs, but you might want to ask future CGI questions in a CGI
group such as comp.infosystems.www.authoring.cgi
--
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Sat, 28 Oct 2000 17:05:03 +0200
From: "Aurelio Balgera" <aurelio@b-soft.com>
Subject: Unpack tamplate
Message-Id: <8tepga$iap$1@fe2.cs.interbusiness.it>
Can anyone help me to write the exact unpack template to convert this CPP
structure:
struct V5Flow
{
unsigned long srcaddr;
unsigned long dstaddr;
unsigned long nexthop;
unsigned short input;
unsigned short output;
unsigned long dPkts;
unsigned long dOctets;
unsigned long First;
unsigned long Last;
unsigned short srcport;
unsigned short dstport;
char pad1[1];
unsigned char tcp_flags;
unsigned char prot;
unsigned char tos;
unsigned short src_as;
unsigned short dst_as;
unsigned char src_mask;
unsigned char dst_mask;
char pad2[2];
}
------------------------------
Date: Sat, 28 Oct 2000 17:06:18 +0200
From: "Aurelio Balgera" <aurelio@b-soft.com>
Subject: Unpack tamplate
Message-Id: <8tepgb$iap$2@fe2.cs.interbusiness.it>
Can anyone help me to write the exact unpack template to convert this CPP
structure:
struct V5Flow
{
unsigned long srcaddr;
unsigned long dstaddr;
unsigned long nexthop;
unsigned short input;
unsigned short output;
unsigned long dPkts;
unsigned long dOctets;
unsigned long First;
unsigned long Last;
unsigned short srcport;
unsigned short dstport;
char pad1[1];
unsigned char tcp_flags;
unsigned char prot;
unsigned char tos;
unsigned short src_as;
unsigned short dst_as;
unsigned char src_mask;
unsigned char dst_mask;
char pad2[2];
}
------------------------------
Date: Sat, 28 Oct 2000 17:58:39 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Unpack tamplate
Message-Id: <ant28163963dfNdQ@oakseed.demon.co.uk>
In article <8tepgb$iap$2@fe2.cs.interbusiness.it>, Aurelio Balgera
<URL:mailto:aurelio@b-soft.com> wrote:
> Can anyone help me to write the exact unpack template to convert this CPP
> structure:
>
[snip]
Doesn't that rather depend on which platform and C++ implementation
we're talking about? I would expect the size, endianness, and possible
padding in the structure to vary depending on platform etc. You might
do better to try unpacking the structure yourself and experimenting
until you get the template to extract the correct values.
Sorry, I wasn't more helpful.
--
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Sat, 28 Oct 2000 06:55:06 -0400
From: William Lewis Brown <bbrown@addtoit.com>
Subject: Re: use strict; with eval:: error messages to stderr
Message-Id: <39FAB08A.A8EDFF4E@addtoit.com>
Hi Sean,
Thanks very much for this work around Sean. In order to understand how it
works, I had to spend a few minutes with "Programming Perl"'s index. The result
was very educational.
Thanks again.
Bill
ps. I hope you don't mind. I have made you a recipient of my next
question directed to com.lang.perl.misc.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sean McAfee wrote:
>
> In article <39F623F2.2A9486A3@addtoit.com>,
> William Lewis Brown <bbrown@addtoit.com> wrote:
> >Hi,
> > I am using eval to compile and run code at runtime. Due to the nature of my
> >environment, this code may at times be incorrect. I do the standard thing and
> >check $@ after an eval to see if the code compiled and ran successfully. I
> >always run with "use strict" and so the code that I am evaling is subject to the
> >"use strict" rules.
> > Unfortunately, it seems as if any errors associated with "use strict" are spit
> >out on stderr and do not appear as part of $@. The error messages I do get in
> >$@ are often very cryptic due to the code not passing the "use strict;" tests.
> > What is the best way for me to work around this problem? It would be ideal if
> >I could get my "use strict;" errors placed in a variable.
>
> As mentioned, this is a bug in versions of Perl prior to 5.6. I got
> around it in earlier versions by doing this:
>
> {
> local $SIG{__WARN__} = \&promote_strictness_warnings;
> eval "whatever";
> error_out() if $@;
> }
>
> sub promote_strictness_warnings {
> local $_ = shift;
> /^Global symbol ".*" requires explicit package name/
> ||
> /^Variable ".*" is imported/
> ||
> /^Bareword ".*" not allowed while "strict subs" in use/
> ||
> /^Can't use string (".*") as .* ref while "strict refs" in use/
> ||
> /^Can't use bareword (".*") as .* ref while "strict refs" in use/
> and
> die $_;
> }
>
> --
> Sean McAfee mcafee@umich.edu
> print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
> q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!
--
William L. Brown
Work: 603-465-2114
Fax: 603-465-2114
Cell: 617-803-9156
Email: bbrown@addtoit.com
Home: 603-465-2948
------------------------------
Date: Sat, 28 Oct 2000 21:22:58 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: what does /warn "$x" if "$x"/ mean
Message-Id: <slrn8vla82.c8.mgjv@martien.heliotrope.home>
On Fri, 27 Oct 2000 23:54:04 -0700,
Larry Rosler <lr@hpl.hp.com> wrote:
> In article <slrn8vkrpe.c8.mgjv@martien.heliotrope.home>,
> mgjv@tradingpost.com.au says...
>
> ...
>
> > One other thing is important to know aboiut these error messages: They
> > contain an error number.
> >
> > my $errno = $rc =~ /(\d+)/;
>
> But that snippet doesn't capture it.
>
> my ($errno) = $rc =~ /(\d+)/;
>
> It seems surprisingly easy to take one's eye off the ball on that one.
You're right. That'll teach me (or better refresh my memory) to check my
code, or at least copy it from a place where it's in use.
Martien
--
Martien Verbruggen |
Interactive Media Division | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd. | password?
NSW, Australia |
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4750
**************************************