[17547] in Perl-Users-Digest
Perl-Users Digest, Issue: 4967 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 26 06:06:03 2000
Date: Sun, 26 Nov 2000 03:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975236710-v9-i4967@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 26 Nov 2000 Volume: 9 Number: 4967
Today's topics:
ActivePerl ppm help <wstsoi@hongkong.com>
Re: Again problems executing Perl scripts in a shell (Joe Smith)
Re: Backtick problems on Windows98 (Joe Smith)
Re: Backtick problems on Windows98 (Joe Smith)
Re: Can't install modules in ActiveStates v5.6.0 for Wi <jeff@vpservices.com>
Re: Can't install modules in ActiveStates v5.6.0 for Wi <graham@letsgouk.com>
Re: CGI.pm upload problems (Maggert)
Re: Checking if file exists (filename contains a wildca (Joe Smith)
help about activeperl <wstsoi@netvigator.com>
Help about ActivePerl <wstsoi@netvigator.com>
Re: Here is execute cmd perl4 - perl5 (Garry Williams)
Re: How to make something in list context? (Joe Smith)
identifying $_ as variable or constant (Eric Smith)
Re: identifying $_ as variable or constant (Martien Verbruggen)
Re: identifying $_ as variable or constant (Joe Smith)
Re: If/else problem. (Joe Smith)
Re: large file size (Joe Smith)
Re: Mime type - Binary File (Martien Verbruggen)
Re: Need a quick definition of PERL (Joe Smith)
Re: Newbie: How to COMPARE DATES in Perl??? (Joe Smith)
Re: perl for win 32 setup question <johngros@Spam.bigpond.net.au>
Re: perl version of html tag (Joe Smith)
Re: Perl-Expert need (read) (Martien Verbruggen)
Re: Perl-Expert need (read) (Tad McClellan)
Re: PerlIS.dll headers in html <johngros@Spam.bigpond.net.au>
Re: Problem reading/writing binary file (Joe Smith)
Re: Proper use of $ENV{HTTP_REFERER} (Joe Smith)
Re: quick sorting question (Joe Smith)
Re: Reading a backslash in a variable? (Joe Smith)
reading IP and MAC addresses with Win::Registry module <jensluetzen@yahoo.de>
Remove 'suidperl' (Was "Re: running a script as root") (Joe Smith)
Re: Removing carriage returns from cgi (Joe Smith)
Schwern is still alive! <schwern@pobox.com>
Secure vs. unsecure server <ayambema@adelphia.net>
Re: Secure vs. unsecure server (Martien Verbruggen)
Re: uploading files over web (Joe Smith)
Re: Using Net::FTP to print a directory (Earl Mardukas)
What's the use of the Filter Module <sjhall@hallnet.co.uk>
Re: What's the use of the Filter Module (Martien Verbruggen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 26 Nov 2000 18:31:12 +0800
From: "Lucas Gump" <wstsoi@hongkong.com>
Subject: ActivePerl ppm help
Message-Id: <8vqoo8$db72@imsp212.netvigator.com>
Hi all,
I just wanted to upgrade my AactivePerl from 5.22 to the
newest 6.20, so I uninstall the old one and install the new one.
The installation seemed ok but I found ActivePerl did not
add itself into env. path, because I could not lauch my perl
scripts liked 'perl script.pl' or even 'perl -v', it is so weird, is that
I missed something problem of that version of activeperl?
If anybody know where I was going wrong, please tell me, thanks.
Thanks
------------------------------
Date: 26 Nov 2000 05:31:46 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Again problems executing Perl scripts in a shell
Message-Id: <8vq782$2lvd$1@nntp1.ba.best.com>
In article <3A01AD2A.F079A8E3@teleline.es>,
PiLoT <spamming@teleline.es> wrote:
>Hi all!
>
>Sorry, but this is my real e-mail address.
>
>I've made a perl script and I can only execute in that way:
>$ perl script_name.pl
>
>I put the 'x' permission to the perl and the header of the script
>contain:
>#!/usr/bin/perl
>and I've checked that perl is in that directory.
I interpret "put the 'x' permission to the perl" as
chmod +x /usr/bin/perl
which is not the same as
chmod +x script_name.pl
and the latter needs to be done.
>I want to execute the script with
>$ ./script_name.pl
>How can I do that???
If your perl script was uploaded via FTP in binary mode instead of text
mode, it may contain MS-DOS end-of-line characters ("\r\n") instead of
the Unix eol ("\n"). Here's one way to check:
unix% perl -pi.bak -e 'tr/\r//d' temp.pl
unix% ls -l temp.pl temp.pl.bak
-rwxrwxr-x 1 inwap best 39 Nov 25 21:29 temp.pl*
-rwxrwxr-x 1 inwap best 41 Nov 25 21:28 temp.pl.bak*
This example shows that two \r characters were deleted from temp.pl, and
now it can be executed as "./temp.pl".
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 07:23:01 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Backtick problems on Windows98
Message-Id: <8vqdol$2v0d$1@nntp1.ba.best.com>
In article <8ubg3a$g5b$1@newstoo.ericsson.se>,
Peter Lerup <peter.lerup@ecs.ericsson.se> wrote:
>Ok let me try and clarify my somewhat imprecise first post:
>All machines are running the same version of Perl (from the same location on
>the network). I've tried 5.003_07 build 315 (which we normally use) and
>5.6.0 build 613. The machines are using the exact same version of Windows98
>(as far as I can tell), however the hardware is different
What about PATH on each machine?
C:\> perl -ls "print $ENV{PATH}"
>The `dir` was just used in order to try and provide a simple example.
Using backticks with commands that are built into command.com is a losing
proposition. Try using an EXE file that only outputs to STDOUT.
C:\>perl -le "$a=`netstat -rn`; print 'a=',$a;"
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 07:30:05 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Backtick problems on Windows98
Message-Id: <8vqe5t$2vjs$1@nntp1.ba.best.com>
In article <8uhmr7$g11$1@newstoo.ericsson.se>,
Peter Lerup <peter.lerup@ecs.ericsson.se> wrote:
>Yes, well the strange thing is that on the machines where the backticks did
>work, NAV was also installed. Not to sure about possible differences in
>program versions though, but will check.
If Norton AntiVirus is installed, and it is configured to look for
viruses in memory, and you use backticks or system() in perl, then
strange things happen. Including four quick accesses to the A: drive
for no apparent reason. Disabling scan-for-viruses-in-memory changes
the symptoms.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sat, 25 Nov 2000 15:04:23 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Can't install modules in ActiveStates v5.6.0 for Win32
Message-Id: <3A204577.E970300D@vpservices.com>
Graham Stow wrote:
>
> When trying to install a module and running 'Makefile.pl', I get a 'Bad
> command or file name' 'Unable to find a perl 5 (by these names:
> C\Perl\bin\Perl.exe miniperl perl perl5 perl5.6.0, in these dirs:
> C:\WINDOWS\COMMAND C:\PERL\BIN C:\Perl\bin)
>
> I'm running ActiveState's perl v5.6.0 for Win32-x86, Binary build 616,
> installed in C:\Perl
Build 616 has a serious bug that causes that error message. Upgrade and
the problem will go away.
--
Jeff
------------------------------
Date: Sun, 26 Nov 2000 10:53:27 +0000
From: Graham Stow <graham@letsgouk.com>
Subject: Re: Can't install modules in ActiveStates v5.6.0 for Win32
Message-Id: <cg1lEGAnuOI6Eww5@letsgouk.com>
In article <3A204577.E970300D@vpservices.com>, Jeff Zucker
<jeff@vpservices.com> writes
>Graham Stow wrote:
>>
>> When trying to install a module and running 'Makefile.pl', I get a 'Bad
>> command or file name' 'Unable to find a perl 5 (by these names:
>> C\Perl\bin\Perl.exe miniperl perl perl5 perl5.6.0, in these dirs:
>> C:\WINDOWS\COMMAND C:\PERL\BIN C:\Perl\bin)
>>
>> I'm running ActiveState's perl v5.6.0 for Win32-x86, Binary build 616,
>> installed in C:\Perl
>
>Build 616 has a serious bug that causes that error message. Upgrade and
>the problem will go away.
>
I'm not at all sure you're right there. Rob from Aussie has emailed me
pointing out that I should be retrieving and installing ActiveState
modules (http://www.activestate.com/PPMpackages/5.6/, as opposed to
those obtained from CPAN) using PPM (Perl Package Manager). When I do
that, everything is hunky-dory!
--
Graham Stow
------------------------------
Date: Sun, 26 Nov 2000 00:45:51 GMT
From: mag@ionet.net (Maggert)
Subject: Re: CGI.pm upload problems
Message-Id: <3a205d0a.19978677@news.ionet.net>
On 23 Nov 2000 18:38:31 +0000, nobull@mail.com wrote:
>Just curious, if you didn't use CGI.pm for upload just what did you use?
>
You could also use CGI_Lite which does a very good and easy
job of uploading files.
MP
------------------------------
Date: 26 Nov 2000 08:57:39 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Checking if file exists (filename contains a wildcard)
Message-Id: <8vqja3$4tf$1@nntp1.ba.best.com>
In article <1FfT5.100$d7.1840@read1.centurytel.net>,
Ana Dominguez <ana.dominguez@centurytel.com> wrote:
>Hello,
>
>I have tried to use the -e function to determine if a file exists but my
>filename contains *s in its name. The function always returns false. Is
>there a different function that can be used?
If you have an actual file that has an asterisk in its name, you can
use the -e file test as is.
If you have a wildcard (a string that may include asterisk, question
mark, square or curly brackets), then you need to expand the wildcard
into a list of file names before using any file tests.
$wildcard = "*.txt";
foreach $file (glob $wildcard) {
print "The file '$file' exists\n" if -e $file;
}
>My program is trying to move files from one directory to another. The
>script runs on a Unix system ...
If you use "perl test.pl *.txt" on a Unix system, the test.pl script
will not see the asterisk because the shell expands wildcards before
invoking the program. The same command line on a non-Unix system may
or may not work the same. In the cases where it is not the same,
the glob() function can be used inside the perl program as shown above.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sat, 25 Nov 2000 14:49:20 +0800
From: "Lucas" <wstsoi@netvigator.com>
Subject: help about activeperl
Message-Id: <8vnn8f$fg42@rain.i-cable.com>
Hi,
I used ActivePerl as my perl tool in Win32.
However today I just wanted to uninstall ActivePerl5.22
and install ActivePerl6.20 into my Win98, I found I could
not run the perl scripts from command line liked "perl example.pl"
or even 'perl -v", it seemed that ActivePerl did not add itself into
my env. path, How could it happen or anything i was going wrong?
Thanks.
------------------------------
Date: Sat, 25 Nov 2000 15:03:52 +0800
From: "Lucas" <wstsoi@netvigator.com>
Subject: Help about ActivePerl
Message-Id: <8vno3n$fg73@rain.i-cable.com>
Hi,
I used ActivePerl as my perl tool in Win32.
However today I just wanted to uninstall ActivePerl5.22
and install ActivePerl6.20 into my Win98, I found I could
not run the perl scripts from command line liked "perl example.pl"
or even 'perl -v", it seemed that ActivePerl did not add itself into
my env. path, How could it happen or anything i was going wrong?
Thanks.
------------------------------
Date: Sun, 26 Nov 2000 03:13:33 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: Here is execute cmd perl4 - perl5
Message-Id: <xd%T5.1744$xb1.105935@eagle.america.net>
On Sat, 25 Nov 2000 20:40:59 GMT, danfan <van.Ginhoven@Telia.com>
wrote:
>The code below works OK in perl 4 but it won´t compile in perl 5.
>".<< unexpected"
>
>Is there an alternative syntax or is it just superseeded by perlipc
>
>Snippet:
>> (@response)=<<`ENDCMD`;
>> mq001 -v <<ENDCMD
>> myuserid
>> mypassword
>> get job_status
>> get schema_status
>> end
>> ENDCMD
It compiles fine for me (although it won't compile without warnings):
$ cat x
##!/usr/local/bin/perl -w
#use strict;
(@response)=<<`ENDCMD`;
mq001 -v <<ENDCMD
myuserid
mypassword
get job_status
get schema_status
end
ENDCMD
$ perl x
sh: mq001: not found
$ perl -v
This is perl, v5.6.0 built for sun4-solaris
--
Garry Williams
------------------------------
Date: 26 Nov 2000 10:18:21 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: How to make something in list context?
Message-Id: <8vqo1d$bo6$1@nntp1.ba.best.com>
In article <XmHS5.29337$1o5.1105599@news3.aus1.giganews.com>,
Tim Schmelter <schmelter_tim@hotmail.com> wrote:
>"John Lin" <johnlin@chttl.com.tw> wrote in message
>news:8vfcaa$rve@netnews.hinet.net...
>...snip...
>> print "$_\n" for <(<DATA>)>; # directly parenthesize
>
>Close. You want:
> print "$_\n" for (<DATA>);
No, the original posting talked about reading a bunch of wildcards from
a file, and then listing the file names that match those wildcards.
As in
print "$_\n" for (<*.txt *.jpg>);
The ugly way is:
print "$_\n" for (eval '<' . join(" ",<DATA>) . '>');
The better way is:
print "$_\n" for (glob <DATA>);
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 01:00:29 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: identifying $_ as variable or constant
Message-Id: <slrn920o5c.hff.eric@plum.fruitcom.com>
say: $var='something';
In a loop, how can I determine whether the value in $_ is $var or the
constant 'something'?
------------------------------
Date: Sun, 26 Nov 2000 12:29:53 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: identifying $_ as variable or constant
Message-Id: <slrn920psh.imr.mgjv@martien.heliotrope.home>
On 26 Nov 2000 01:00:29 GMT,
Eric Smith <eric@fruitcom.com> wrote:
> say: $var='something';
> In a loop, how can I determine whether the value in $_ is $var or the
> constant 'something'?
What you are asking doesn't make sense. The value stored in $_ is either
the string "something" or it isn't. The value stored in $var is either
the string "something" or it isn't. The value of the constant expression
'something' is always the string "something".
The value in $_ has no memory of where it came from. It either is
"something" or it isn't.
Now, exactly _what_ is it you are asking? Maybe you should be a bit more
verbose, and maybe show us some code that you tried that may illustrate
what you are trying to do.
Martien
--
Martien Verbruggen |
Interactive Media Division | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd. | but mean your mother.
NSW, Australia |
------------------------------
Date: 26 Nov 2000 07:46:51 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: identifying $_ as variable or constant
Message-Id: <8vqf5b$30uk$1@nntp1.ba.best.com>
In article <slrn920o5c.hff.eric@plum.fruitcom.com>,
Eric Smith <ericnntp@fruitcom.com> wrote:
>say: $var='something';
>In a loop, how can I determine whether the value in $_ is $var or the
>constant 'something'?
Are you talking about this:
$var = 'something';
$_ = 'something'; # Copy of a string constant
$_ = $var; # Copy of a string variable
*_ = *var; # Alias to a string variable
*_ = \$var; # " "
*_ = \'something'; # Alias to a string constant
foreach $_ ($var, 'something') { # Alias to var then alias to constant
$_ .= "foo"; # Attempt to modify string constant 2nd time thru
}
If that is the topic, can you tell us why you want to do that?
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 09:06:22 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: If/else problem.
Message-Id: <8vqjqe$5jd$1@nntp1.ba.best.com>
In article <s33T5.460$GW5.3300@news-server.bigpond.net.au>,
John Boy Walton <johngros@Spam.bigpond.net.au> wrote:
>open BOGUS,"+>>$file" or die "Cannot open file: $!";
Opens $file for appending and reading, positions to end of file.
> if ($pass eq <BOGUS>){
Attempt to read beyond end of file, returns undef.
If you are intending to read from a file, "+>>$file" is not the way to do it.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 07:07:11 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: large file size
Message-Id: <8vqcqv$2tqh$1@nntp1.ba.best.com>
In article <3A06CFF9.5AD7C940@dtic.mil>, Dave's box <dshaklee@dtic.mil> wrote:
>I have a 4 gb file that I can't open with "open(LOG, "$log") || die
>"Unable to open $log\n";
>Does perl have a file size limitation? When I split the file in 2 it
>will work . Thanks
You did not state what OS you are using.
SunOS-5.6 and above (Solaris-2.6, Solaris-7, Solaris-8) has the ability
to have files greater than 2GB. Perl version 5.004 and 5.005 do not
use lstat64(), and therefore cannot deal with largefiles.
The version of perl that comes standard with Solaris-8 is 5.005, and
cannot handle largefiles. To use largefiles, upgrade to perl-5.6.0.
[That last sentence applies to other Operating Systems as well.]
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sun, 26 Nov 2000 09:59:00 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Mime type - Binary File
Message-Id: <slrn920h1k.imr.mgjv@martien.heliotrope.home>
On Sat, 25 Nov 2000 14:59:13 +0800,
h <finster@mailexcite.com> wrote:
> Hi,
[scanning for Perl content]
None found.
This appears to be a question about the configuration of some Netscape
product, and the reaction of some other Netscape product to it. Maybe
you should ask in a group that talks about Netscape products?
Why in the world did you ever think that this would be an appropriate
question for a Perl language group?
Don't answer that please.
Martien
--
Martien Verbruggen | Since light travels faster than
Interactive Media Division | sound, isn't that why some people
Commercial Dynamics Pty. Ltd. | appear bright until you hear them
NSW, Australia | speak?
------------------------------
Date: 26 Nov 2000 10:33:48 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Need a quick definition of PERL
Message-Id: <8vqouc$cpt$1@nntp1.ba.best.com>
Keywords: *
In article <9t7m1tgo1d0pv5fbicqcmrcpg4eqrpi225@4ax.com>,
Blueman <bluman@claranews.com> wrote:
>I have to translate a small C++ routine to PERL. Is there a website
>where I can get a basic definition of the language, and maybe a little
>tutorial?
The other guy is teasing you because you said "PERL" instead of "Perl".
http://www.perl.com/pub/doc/manual/html/pod/perlfaq1.html
http://language.perl.com/versus/
If you are serious about learning Perl, you need to purchase a good book.
http://www.oreilly.com/catalog/lperl2/
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 03:54:56 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Newbie: How to COMPARE DATES in Perl???
Message-Id: <8vq1ig$2f6h$1@nntp1.ba.best.com>
In article <CakM5.10991$rl.923945@newsread2.prod.itd.earthlink.net>,
Alan Mailer <clarityassoc@earthlink.net> wrote:
>Thanks to both Clay and Jeff for your suggestions. Unfortunately, I'm
>enough of a newbie to not know what you mean when you say "Check out the
>Perl modules Date::Calc and Date::Manip."
>
>What steps do I take to check out these things? Sorry to sound so naive...
>but there's a first time for everything!
"Check out Date::Calc" => Go to http://search.cpan.org and enter Date::Calc
in the search box.
The README file refers to http://www.engelschall.com/u/sb/download/ and
that page mentions that there are two versions of the module. The original,
written in a mixture of perl and compiled C modules, and a newer version
written entirely in perl.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sun, 26 Nov 2000 05:03:56 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: perl for win 32 setup question
Message-Id: <0R0U5.4841$GW5.31657@news-server.bigpond.net.au>
Have you got perl associated with the extension .pl?
Also try two addhandler lines I have my script extensions on two different
lines.
------------------------------
Date: 26 Nov 2000 09:25:47 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: perl version of html tag
Message-Id: <8vqkur$7bs$1@nntp1.ba.best.com>
In article <8vgotl$ph1$1@nnrp1.deja.com>, <richard_dobson@my-deja.com> wrote:
>I am returning input data from the user to the browser in the form of a
>table. Does anyone know how to specify the cell width so that if the
>data contained in it is over a certain length it starts a new line and
>extends the row downwards instead of across?
Put <br> tags into the text where appropriate.
$item =~ s/(.{20,45}) /$1<br>\n/g;
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sun, 26 Nov 2000 10:08:05 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl-Expert need (read)
Message-Id: <slrn920hil.imr.mgjv@martien.heliotrope.home>
On Sat, 25 Nov 2000 21:06:15 GMT,
Bob Walton <bwalton@rochester.rr.com> wrote:
> Alexander Adam wrote:
You (the OP) posted a job advertisement in a technical language group.
Please, don't do that. Post job ads to groups with the word 'job' in
their name somewhere. This only makes you look clueless.
>> We need someone who can programm a gui around the perl-debugger, just like
>> in ActiveState's Debugger or the Perlbuilder 2.0!
If you want stuff 'just like' those, why don't you buy those?
>> Programming language: Delphi(OP) prefered, but C++ (Visual C++) also
>> accepted!!
Why? Why not Perl?
>> So, can u help us ?
>> You'll be payed very good, of course, but it's very hurry, so please reply
>> us very fast!
I can see from the construction and execution of this sentence that
you're in a terrible hurry. So why not buy or download one?
> Any chance ptksh already provides what you want?
Or ptkdb?
http://search.cpan.org/search?mode=module&query=ptkdb
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing
Interactive Media Division | down all the noises the baby makes so
Commercial Dynamics Pty. Ltd. | later I can ask him what he meant -
NSW, Australia | Steven Wright
------------------------------
Date: Sat, 25 Nov 2000 17:52:27 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl-Expert need (read)
Message-Id: <slrn920glb.3t8.tadmc@magna.metronet.com>
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>On Sat, 25 Nov 2000 21:06:15 GMT,
> Bob Walton <bwalton@rochester.rr.com> wrote:
[ but I think I've snipped all the bwalton lines ]
>> Alexander Adam wrote:
>>> You'll be payed very good, of course, but it's very hurry, so please reply
>>> us very fast!
>
>I can see from the construction and execution of this sentence that
>you're in a terrible hurry. So why not buy or download one?
I invoked the Mark Twainism below on it. It did indeed read better :-)
"Substitute 'damn' every time you're inclined to write 'very';
your editor will delete it and the writing will
be just as it should be." -- Mark Twain
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 26 Nov 2000 05:10:17 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: PerlIS.dll headers in html
Message-Id: <ZW0U5.4850$GW5.31191@news-server.bigpond.net.au>
Try removing the print header line.
------------------------------
Date: 26 Nov 2000 09:18:24 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Problem reading/writing binary file
Message-Id: <8vqkh0$6n7$1@nntp1.ba.best.com>
In article <8vgrfg$rid$1@nnrp1.deja.com>, <toby_m_kramer@hotmail.com> wrote:
># First part: writing binary file
>open (O,">test.dat") or die "Can't open file for writing!\n";
>
>for (my $i=0;$i<1000;$i++) {
> my $buf = pack "NNNa10", $i, $i*10, $i*5, "ABCDEFGHIJ";
> print O $buf;
>}
>close (O);
As the other poster pointed out, you neglected to use binmode().
On the 26th record, $buf will contain a Control-Z character.
Control-Z is the end-of-file indicator for MS-DOS.
Guarenteed failure after 26th record, as you found out.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 09:13:35 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Proper use of $ENV{HTTP_REFERER}
Message-Id: <8vqk7v$65r$1@nntp1.ba.best.com>
In article <B8US5.53139$KI6.11666437@typhoon.snet.net>,
_Thomas <webmaster@860.org> wrote:
>The renaming index.html -> index.cgi thing wouldnt really be a soltion as
>I'd like to track multiple sites thru the cgi call from the <img ...> tag.
You cannot get the infomation you want through <img>.
The suggestion for using index.cgi DOES work. Use it.
Better yet, do postprocessing of the httpd access log.
A good ISP will let you see the access_log for your account.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 10:10:36 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: quick sorting question
Message-Id: <8vqnis$b76$1@nntp1.ba.best.com>
In article <m166lfzxha.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>You've not been to my web page, I see.
I just now revisited it, and noticed that you have a broken GIF.
Time to find a new UNDER_CONSTRUCTION image to feature.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 06:14:54 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Reading a backslash in a variable?
Message-Id: <8vq9ou$2pl2$1@nntp1.ba.best.com>
In article <8tu38p$llp$1@news.luth.se>, Christer <chho65@hotmail.com> wrote:
>cdemaeyer1@mmm.com (CDM) wrote in <8tu0ou$hli$1@magnum.mmm.com>:
>Well, actually I am running the code in a script. :)
>The problem seems to be that when reading a line from a file into a
>variable the string will be of the type "string" and not 'string'.
That is not true. When reading from a file, the contents are read
verbatim. When read from a file, the backslash is an ordinary
character.
>Is there a way to convert a variable between the different types?
No, because there is no difference.
Are you sure the data in your file is what you think it is?
Try this:
perl -nle 'foreach (split //,$_) {print "ord($_) = ",ord}' filename
If you have the three characters a\b in your file, you will see
ord(a) = 97
ord(\) = 92
ord(b) = 98
as output from the one-liner.
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sun, 26 Nov 2000 03:30:39 +0100
From: jens <jensluetzen@yahoo.de>
Subject: reading IP and MAC addresses with Win::Registry module regexp?
Message-Id: <3A2075CF.91CF89CB@yahoo.de>
Dear all,
I am trying to extract the IP addresses from WinNT compters by means of
perl (Win32::Registry-module). I did already succeed to search the
registry to return into a file all those values that match the pattern
d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}. Unfortunately, there are also values
in the respective subkeys that are equal or greater to 255 (thus
submasks or other stuff..). I tried all kinds of things to get rid of
those already (like loading the scalar into an array and splitting it..)
but none of my efforts were successful.. Is there a way to solve the
problem with regular expressions? More and more I am thinking I might
have the wrong strategy since I also have to extract the MAC-addresses
of the machines.. maybe there is another way?
Any help is super much appreciated,
jens
jensluetzen@yahoo.de
------------------------------
Date: 26 Nov 2000 09:38:43 GMT
From: inwap@best.com (Joe Smith)
Subject: Remove 'suidperl' (Was "Re: running a script as root")
Message-Id: <8vqln3$8h5$1@nntp1.ba.best.com>
In article <slrn91nptf.2i5.vek@pharmnl.ohout.pharmapartners.nl>,
Villy Kruse <vek@pharmnl.ohout.pharmapartners.nl> wrote:
>Perl somtimes comes with suidperl that alows the suid bit
>to be honoured. This may or may not work on a specific system.
If you have an old program called 'suidperl' on your system, REMOVE
IT IMMEDIATELY!!!!!! There is a giant security hole in the
suidperl program which used to be distributed with perl. The hole
was so bad, that the only way to "fix" the problem is to remove
the offending executable.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 26 Nov 2000 05:57:57 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Removing carriage returns from cgi
Message-Id: <8vq8p5$2o0c$1@nntp1.ba.best.com>
In article <9noM5.45612$E85.1153991@news1.sttls1.wa.home.com>,
John <nobodyshere@com.home> wrote:
>When I go to write mailingaddress to a file.. I get those damned ^M all over
>the place.
>
>I can't seem to take those out.. I though chomp would have done it.
The other reponses to this thread explain HOW; here is WHY.
If you're running a Win32 perl and reading a Win32 file, chomp removes
both the ^M and ^J ("\r\n"). If you're running a Unix perl and reading
data that came from Win32, chomp will remove the "\n" but not the "\r".
Moral of the story: When working with data that came across the net
(specificially via FTP or HTTP), the application needs to explicitly
check for and handle alternative line endings.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sun, 26 Nov 2000 05:06:53 GMT
From: Michael G Schwern <schwern@pobox.com>
Subject: Schwern is still alive!
Message-Id: <3A209AB9.77E19222@pobox.com>
After a prolonged disconnection from the Internet, I'm back! I was
fortunate enough to preserve my cat-5 connection on ice and the doctors
say the scar will barely be noticable. Anyone who's been trying to send
me mail for the past few months (since the end of August about), whether
it bounced or not, resend it. I've got about a month's worth of mail
locked away where I can't get at it.
So just letting everyone know that schwern@pobox.com is active again and
http://www.pobox.com/~schwern/ will be useful soon. My modules are, and
have always been, on CPAN
(http://search.cpan.org/search?mode=author&query=MSCHWERN) and have not
been abandoned. New versions of AnyLoader and Class::DBI are
forthcoming as well as a new module Geo::TigerLine (manipulation of
TIGER/Line census maps).
------------------------------
Date: Sun, 26 Nov 2000 04:25:44 GMT
From: "hokiebear" <ayambema@adelphia.net>
Subject: Secure vs. unsecure server
Message-Id: <ch0U5.2737$tR2.84480@news1.news.adelphia.net>
I have a Perl script that has been debugged (using perl -d myscript) and
works fine on a non-secure server. However, when it is transferred to a
secure server, it generates an error. Are there any special adjustments that
one must make to a code on transferring from a non-secure to a secure
server? I am relatively new to Perl so every possible pointer would help.
Thanks a million.
amba
------------------------------
Date: Sun, 26 Nov 2000 15:52:46 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Secure vs. unsecure server
Message-Id: <slrn9215ou.imr.mgjv@martien.heliotrope.home>
On Sun, 26 Nov 2000 04:25:44 GMT,
hokiebear <ayambema@adelphia.net> wrote:
> I have a Perl script that has been debugged (using perl -d myscript) and
> works fine on a non-secure server. However, when it is transferred to a
> secure server, it generates an error. Are there any special adjustments that
> one must make to a code on transferring from a non-secure to a secure
> server? I am relatively new to Perl so every possible pointer would help.
Nothing different as far as Perl is concerned. However, it isn't
impossible that the environment that the program runs is is slightly
different. It may be related to the server you run on, and the
configuration of that server. 'd give you the best chance to find a
solution if you posted this question on one of the group in
comp.infosystems,www.* somewhere, and providing a bit more information.
Do you use the CGI module? Have you handrolled your CGI interface
handling stuff? If so, which environment stuff do you rely on?
If you don't use the CGI.pm module, this has almost certainly become a
non-Perl issue, because very likely you've implemented something in the
CGI protocol incorrectly, or not according to the specification.
Martien
--
Martien Verbruggen | Since light travels faster than
Interactive Media Division | sound, isn't that why some people
Commercial Dynamics Pty. Ltd. | appear bright until you hear them
NSW, Australia | speak?
------------------------------
Date: 26 Nov 2000 10:54:53 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: uploading files over web
Message-Id: <8vqq5t$eeb$1@nntp1.ba.best.com>
In article <GImS5.38036$SF5.712544@ozemail.com.au>,
Troy Rasiah <troyr@vicnet.net.au> wrote:
>Hi there...
> I have a simple file uploading html/cgi page that uploads files to a
>server. My problem is that I want a progress bar or even dots going across
>the screen as the file uploads. My HTML only comes on the screen once the
>file has finished uploading.
> while (my $bytesread = read($file, my $buffer, 1024)) {
> print ". ";
> print OUTFILE $buffer;
> }
1) Unless you have '$|=1;' near the top of your script, the output from
'print ". ";' won't be sent to the browser until your script exits.
2) Sending characters like that will make sure that the browser does
not abort too soon with "Connection timed out", which is good.
However, the browser will not display anything on the screen until
it has a full line of text to render. This will help slightly:
print $count++ % 10 ? ". " : "<br>\n"; # New line every 10th buffer
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sat, 25 Nov 2000 22:38:43 -0500 (EST)
From: The-Duke-of-URL@webtv.net (Earl Mardukas)
Subject: Re: Using Net::FTP to print a directory
Message-Id: <3176-3A2085C3-9@storefull-111.iap.bryant.webtv.net>
Thank you, Tony.
------------------------------
Date: Sat, 25 Nov 2000 23:33:55 GMT
From: "Stephen Hall" <sjhall@hallnet.co.uk>
Subject: What's the use of the Filter Module
Message-Id: <D%XT5.16070$ws2.1692321@news3.cableinet.net>
Hi,
I have been looking for a way to hide the source of perl script for months
now, I've tried compiling to C and bytecode and scrambling the names of the
variables but non of these options seem viable. The Filter module
(http://cpan.valueclick.com/modules/by-module/Filter/) seems to be exactly
what I'm looking for but after reading the documentation it seems that you
have to write a module to decrypt your code before it's run so what's the
point. Surely anyone could just run your descriptor on it's own and walk
away with the code?
Anyway if anyone else has found out what the filter module is for I would be
grateful to know.
Thanks
Stephen Hall
------------------------------
Date: Sun, 26 Nov 2000 12:32:06 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: What's the use of the Filter Module
Message-Id: <slrn920q0m.imr.mgjv@martien.heliotrope.home>
On Sat, 25 Nov 2000 23:33:55 GMT,
Stephen Hall <sjhall@hallnet.co.uk> wrote:
> Hi,
> I have been looking for a way to hide the source of perl script for months
Perl FAQ, section 3
How can I hide the source for my Perl program?
If you have read it, then I wonder why you went through all the
trouble. If you haven't, then I suggest you do it now.
You don't give us the reasons WHY you want to 'hide' your code, but the
FAQ mentiones a few.
Martien
--
Martien Verbruggen |
Interactive Media Division | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
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 4967
**************************************