[10762] in Perl-Users-Digest
Perl-Users Digest, Issue: 4363 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 5 04:07:24 1998
Date: Sat, 5 Dec 98 01:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 5 Dec 1998 Volume: 8 Number: 4363
Today's topics:
80 column conversion (Jaya_Kanajan)
Re: 80 column conversion <rick.delaney@shaw.wave.ca>
Re: 80 column conversion (Tad McClellan)
Re: 80 column conversion <ebohlman@netcom.com>
Re: ActivePerl perlscript and IIS <ebohlman@netcom.com>
Re: can match $n times be done? (Larry Rosler)
Re: can match $n times be done? <ebohlman@netcom.com>
CONFIG.PM: EDITING SERVER NAMES in %NetConfig <dpainter@lightspeed.net>
Re: Environment variables.... (Kevin Kelley)
Re: Fastest way to search through an array? <ebohlman@netcom.com>
How can I make it impossible to use the browser's back Rafely@xxiname.com
Re: How can I make it impossible to use the browser's b (Rich)
Re: How do I make an EXE in Win 98? <tec@2.sbbs.se>
How to disallow fields to input puncuations excepts targetmailinfo@yahoo.com
Re: Merge Files <ebohlman@netcom.com>
Re: newbie file open question <aqumsieh@matrox.com>
Re: newbie file open question (Larry Rosler)
newbie question searching string with =~ jlhughes@pobox.com
Re: newbie question searching string with =~ (Sam Holden)
Perl or Perl Script on PWS on Win95 <bart.wical@lmco.com>
Re: perlshop 3.1 (Marc)
Re: perlshop 3.1 (Steve)
Re: Problem with seek..... <asweeney@cisco.com>
Re: Recipe Database for Unix <perlguy@technologist.com>
Re: Sorting VERY large files effeciently <asweeney@cisco.com>
Re: Threads and Perl? <zenin@bawdycaste.org>
Re: Tool to reverse engineer perl code <zenin@bawdycaste.org>
Re: Understanding the debugger (Ilya Zakharevich)
using exec cmd (geekman)
What I would like to see in the next major release of P <Steven.Sagaert@cdc.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Dec 1998 04:54:32 GMT
From: jkanajan@ets.cis.brown.edu (Jaya_Kanajan)
Subject: 80 column conversion
Message-Id: <74aea8$rdd@cocoa.brown.edu>
hi,
i want to make sure that if the length of any of the lines coming in
to $_ are greater than 80, then they should be split down to less than
80 columns per line. so if a line were 210 chars long, it should become
80,80,50 chars lines.
now, i was trying to figure out a way to only split the line by spaces
cuz the input is text and one dosen't want to split it at character
positions.
here's the basic function i was trying to do. has anyone done something
similar?
#!/usr/local/bin/perl
use Getopt::Std;
$outfile = $ARGV[$#ARGV];
$infile = $ARGV[$#ARGV-1];
open(CODE,"<$infile");
open(OUT,">>$outfile");
while (<CODE>) {
print OUT $_ # i need to work on this part
}
close(CODE);
close(OUT);
any suggestions or pointers would be greatly appreciated.
thanks,
jaya
------------------------------
Date: Sat, 05 Dec 1998 05:05:07 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: 80 column conversion
Message-Id: <3668C0B8.1ACC07B3@shaw.wave.ca>
[posted & mailed]
Jaya_Kanajan wrote:
>
> now, i was trying to figure out a way to only split the line by spaces
> cuz the input is text and one dosen't want to split it at character
> positions.
>
Sounds like you want to use Text::Wrap as suggested in the FAQ, "How do
I reformat a paragraph?"
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Sat, 5 Dec 1998 01:12:04 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: 80 column conversion
Message-Id: <4cma47.uhc.ln@metronet.com>
Jaya_Kanajan (jkanajan@ets.cis.brown.edu) wrote:
: i want to make sure that if the length of any of the lines coming in
: to $_ are greater than 80, then they should be split down to less than
: 80 columns per line. so if a line were 210 chars long, it should become
: 80,80,50 chars lines.
use Text::Wrap;
: #!/usr/local/bin/perl
You should enable warnings on *every* Perl program.
Really.
All of them:
#!/usr/local/bin/perl -w
: use Getopt::Std;
I don't see where you are using anything from that module.
What's it there for?
: $outfile = $ARGV[$#ARGV];
: $infile = $ARGV[$#ARGV-1];
That will work but it sure is hard on the eyes (read: hard
to maintain).
You might want to consider some alternatives:
1)
$outfile = $ARGV[-1];
$infile = $ARGV[-2];
2)
$infile = shift; # this one modifies the @ARGV array though...
$outfile = shift;
3)
($infile, $outfile) = @ARGV;
: open(CODE,"<$infile");
You should *always* check the return value from open() calls:
open(CODE, $infile) || die "could not open '$infile' $!";
: open(OUT,">>$outfile");
Why open it for append rather that for output?
You should be checking the return value from *all* open() calls:
open(OUT,">$outfile") || die "could not open '$outfile' $!";
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 5 Dec 1998 08:16:35 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: 80 column conversion
Message-Id: <ebohlmanF3HGBo.Dq9@netcom.com>
Jaya_Kanajan <jkanajan@ets.cis.brown.edu> wrote:
: i want to make sure that if the length of any of the lines coming in
: to $_ are greater than 80, then they should be split down to less than
: 80 columns per line. so if a line were 210 chars long, it should become
: 80,80,50 chars lines.
: now, i was trying to figure out a way to only split the line by spaces
: cuz the input is text and one dosen't want to split it at character
: positions.
No need to reinvent the wheel. Take a look at the Text::Wrap module that
comes with the standard distribution. It's designed for exactly this
sort of thing. If, after looking at it, you find it wanting, go over to
CPAN and take a look at the Text::Format module before you decide to
implement the splitting yourself.
------------------------------
Date: Sat, 5 Dec 1998 08:04:26 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: ActivePerl perlscript and IIS
Message-Id: <ebohlmanF3HFrE.D98@netcom.com>
brian.parks@stn.siemens.com wrote:
: <%@ LANGUAGE = PerlScript %>
: <html>
: <body>
: <%
: $Response->write("Hello World");
: %>
: </body>
: </html>
: My browser returns the following error message:
: ---------------------------------------------------------------------------
: $Response->writeblock(0); $Response->write("Hello World"); error '80004005'
: Can't call method "writeblock" on an undefined value.
: ?
: ----------------------------------------------------------------------------
: Does anyone have any idea what could be causing this??
Yes. $response is supposed to be a reference to an object of some sort,
but it never got set.
------------------------------
Date: Fri, 4 Dec 1998 20:55:04 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: can match $n times be done?
Message-Id: <MPG.10d25c86c9c8bdcc98993f@nntp.hpl.hp.com>
In article <tt9a47.jmb.ln@metronet.com> on Fri, 4 Dec 1998 21:39:41 -
0600, Tad McClellan <tadmc@metronet.com> says...
> Paul J. Lucas (pjl@be-NOSPAM-st.com) wrote:
> : I have a string of words I want to truncate after the nth word
> : where $n is a variable:
>
> : $_ = "now is the time for all good men";
> : $n = 5;
> : $pat = "^((?:[^\s]+\s+){$n}).*";
> : s/$pat/$1/o;
>
> : doesn't work, nor does:
...
> $pat = "^((?:[^\\s]+\\s+){$n}).*";
>
> And it would have worked ;-)
But it would also capture the first value of $n (which is a variable)
into the regex for all time. You cannot use the '/o' modifier when $n
and hence $pat is a variable.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 5 Dec 1998 08:12:16 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: can match $n times be done?
Message-Id: <ebohlmanF3HG4G.DJK@netcom.com>
Paul J. Lucas <pjl@be-NOSPAM-st.com> wrote:
: I have a string of words I want to truncate after the nth word
: where $n is a variable:
: $_ = "now is the time for all good men";
$_ = join '', split (/(\W+)/, $_, 2*$n-1);
------------------------------
Date: Fri, 04 Dec 1998 20:36:00 -0800
From: "David L. Painter" <dpainter@lightspeed.net>
Subject: CONFIG.PM: EDITING SERVER NAMES in %NetConfig
Message-Id: <3668B830.F7B2F89F@lightspeed.net>
I just finished installing Perl 5.005, and in the
installation README file I'm told that the "%NetConfig"
variable in the "config.pm" file needs to be changed.
However, the "config.pm" file has the following warning
about the "%NetConfig" variable:
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING
#
# Below this line is auto-generated, *ANY* changes will be lost
%NetConfig = (
test_hosts => '0',
nntp_hosts => ['news'],
snpp_hosts => [],
pop3_hosts => [],
ftp_ext_passive => '0',
smtp_hosts => ['mailhost'],
inet_domain => 'nowhere.com',
ph_hosts => ['dirserv'],
test_exist => '0',
daytime_hosts => [],
ftp_int_passive => '0',
ftp_firewall => undef,
time_hosts => [],
It looks like if I change the server settings, the values will just be
reset automatically.
What is the proper way to set this variable?
Will my changes be overwritten?
Thanks.
--
David L. Painter
Kraftwerk Web Design
dpainter@prontomail.com
dpainter@lightspeed.net
ph: 209-292-5366
fx: 209-292-0410
------------------------------
Date: Sat, 05 Dec 1998 07:13:06 GMT
From: kelley@ruralnet.net (Kevin Kelley)
Subject: Re: Environment variables....
Message-Id: <366e97da.13701394@news.newsguy.com>
"Casema" <ours@casema.net> wrote:
> I am trying to figure out how to write a counter-script.
...and when you get that done, we could use an anti-spam, maybe
a nega-Gates (negates?) as well. Thirsty? Try the un-cola!
[I would have helped, but this was much more fun!]
Kevin Kelley
--
Starlight Software Co. http://www.kevin-kelley.com/
________________________________________________________________________
> I hate grammaticle errors!
Me to!
------------------------------
Date: Sat, 5 Dec 1998 07:39:14 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Fastest way to search through an array?
Message-Id: <ebohlmanF3HELE.C5I@netcom.com>
Uri Guttman <uri@ibnets.com> wrote:
: >>>>> "TS" == Tk Soh <r28629@email.sps.mot.com> writes:
: TS> my %temp = map {$_, undef} @master_list;
: TS> foreach (@pop_user) {
: TS> push @master_list, $_ if exists $temp{$_};
: TS> }
: this is just a grep so use it:
: push @master_list, grep( exists $temp{$_}, @pop_user ) ;
: you need the exists since we created the hash with values of undef
Actually, you need 'not exists' because the original code actually set
@master_list to the union of its old value and @pop_user.
------------------------------
Date: Fri, 04 Dec 1998 21:51:22 GMT
From: Rafely@xxiname.com
Subject: How can I make it impossible to use the browser's back button in a script??
Message-Id: <3668566a.14311871@news.iaehv.nl>
Hello,
Sorry if the subject was not so clear, but here is what I want to do.
I have a database with members. When members log in, they will get a
menu. Using the menu they can edit their account or configure the
service they receive. Members can also delete their account. When
someone delete their account, they will get a confirmation screen. But
they can always use their back button to go back to the menu, and try
to configure stuff! This could harm the database!! What I want to do
is make it impossible to return to the menu when a member delete their
account. How can I do that? Please let me know.
Many Thanks
Rafely
Rafely@xxiname.com
------------------------------
Date: 5 Dec 1998 04:46:35 GMT
From: richm@ucesucks.mulveyr.roc.servtech.com (Rich)
Subject: Re: How can I make it impossible to use the browser's back button in a script??
Message-Id: <slrn76hej6.11a.richm@ll.aa2ys.ampr.org>
On Fri, 04 Dec 1998 21:51:22 GMT, Rafely@xxiname.com <Rafely@xxiname.com> wrote:
>Hello,
>
>Sorry if the subject was not so clear, but here is what I want to do.
>I have a database with members. When members log in, they will get a
>menu. Using the menu they can edit their account or configure the
>service they receive. Members can also delete their account. When
>someone delete their account, they will get a confirmation screen. But
>they can always use their back button to go back to the menu, and try
>to configure stuff! This could harm the database!! What I want to do
>is make it impossible to return to the menu when a member delete their
>account. How can I do that? Please let me know.
>
Well, the first thing to do is to post your questions to an
appropriate newsgroup.
This isn't it.
- Rich
--
Rich Mulvey
My return address is my last name,
followed by my first initial, @mulveyr.roc.servtech.com
http://mulveyr.roc.servtech.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa
------------------------------
Date: Sat, 05 Dec 1998 06:47:07 +0100
From: tec <tec@2.sbbs.se>
Subject: Re: How do I make an EXE in Win 98?
Message-Id: <3668C8DB.2289D591@2.sbbs.se>
Well you could do it as you start all .pl files whit perl!
Geoffrey Cleaves wrote:
> Can somebody please lead me in the right direction, please. I am
> (fairly) new to Perl, so I kindly ask for a little detail and maybe an
> example or two. I'm not looking to compile my scripts to hide them from
> anybody, I just want to make it easier to run them and I'm just curious
> to know if it is possible. Thanks for any help.
------------------------------
Date: Sat, 05 Dec 1998 07:51:19 GMT
From: targetmailinfo@yahoo.com
Subject: How to disallow fields to input puncuations excepts
Message-Id: <74aolo$qt4$1@nnrp1.dejanews.com>
Dear perl and cgi experts,
If I want to disallow my visitors to input all puncuations and blank
space EXCEPT HYPHEN ( - ) and A to Z , 0 to 9 at my form's field "company"
how can I do that??
The following will disallow all puncuations , blank spaces and hyphen as
well (only allow a-z and 0-9).
How to enable the hypens , a-z , 0-9 but disable blank space and other
puncuations at the company??
if ($form{'company'} =~ /\W/)
{
print "Content-type: text/html\n\n";
print <<__W1__;
<h1>No puncuations please, only allow A-Z 0-9 and hyphens.</h1>
__W1__
exit;
}
Thank you Thank you Thank you
LaHaHaHaHa
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 5 Dec 1998 08:01:07 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Merge Files
Message-Id: <ebohlmanF3HFLy.D5B@netcom.com>
Bruce Davidson <group95@allied.demon.co.uk> wrote:
: Would appreciate help to merge contents of * several flat files (pipe delim)
: into one flat file, leaving originals intact. Something that would work with
: Active Perl on W95.
Depends on how you define "merge" in terms of handling duplicate
entries. If you don't want to eliminate duplicates, you don't need Perl;
"copy file1+file2+...+filen oneflatfile" will do just fine. If you do
want to eliminate duplicates, you need to define which one to keep; the
first one seen, the last one seen, or the one selected by some inspection
of its contents. Regardless of which one you choose, you'll almost
certainly want to use a hash for duplicate checking.
------------------------------
Date: Fri, 4 Dec 1998 14:06:10 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: newbie file open question
Message-Id: <x3yogpj3f61.fsf@tigre.matrox.com>
23_skidoo <nospam23_skidoo@geocities.com> writes:
>
> > One problem: Your code did this:
> > foreach $line (@lines) {
> > ...
> > $line++;
> >
> > This probably won't work right, because $line contains both
> > the number and a newline, so (strictly speaking) it's not a
> > number, and who know what ++ will do to it? It's a bit more
Probably???? what do you mean? why not surely?? why don't you check?
why do you think it won't work? why don't you KNOW what it does?
The ++ will just place $line in a numeric context, and then add 1 to
it. Simple.
> > code, but it'd be safer to pull the number out:
> > if (($num,$rest) = ($line =~ /^(\d+)(.*)/)) {
> > $line = ++$num . $rest;
> > }
> > This will increment the first number if $line starts with
> > a number, and leave the rest of the line unchanged.
what if the numer is negative? or has a decimal part? or is written in
scientific notation?
Your little solution will fail then.
> >
> > <insert perl mantra "There's more than one way to do it" here>
Ohhh yeah!
> chanting that mantra as i go, could i not just chomp($line) ? perl is
yeah you could .. but that is only useful if the line contains only
a number followed by a \n.
> pretty forgiving about being handed a string and treating it as a number
> isn't it? or is that a 'doable but that doesn't mean you should do it'
Perl does what you want .. unless you want consistency!
(was the above sentence relevant here??? heck I like it!)
> thing? (newbie perl hacker but i've been reading the word crufty a lot
> round here, never felt the need to ask what it meant as it seemed pretty
> self evident :)
>
> -23
Well, I am sorry to say that you have not unveiled the secrets of Perl
yet. If a string begins with a number and is used in a numeric context,
then its numeric value will be that number and all \D characters will
be evaluated to 0. You don't even have to chomp() :-D
Ex.
% perl -w
$a="23this\n";
$a++;
print "A is $a.\n";
__END__
Output:
A is 24.
TMTOWTDI ... I agree .. but some WTDIs are easier than others.
Back to real life ..
Ala
------------------------------
Date: Fri, 4 Dec 1998 22:58:47 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie file open question
Message-Id: <MPG.10d27982f1aa6371989940@nntp.hpl.hp.com>
In article <x3yogpj3f61.fsf@tigre.matrox.com> on Fri, 4 Dec 1998
14:06:10 -0500 , Ala Qumsieh <aqumsieh@matrox.com> says...
...
> % perl -w
> $a="23this\n";
> $a++;
> print "A is $a.\n";
> __END__
>
> Output:
> A is 24.
If one replaces '$a++;' by its semantic equivalent, '$a += 1;', one gets
a warning about non-numeric in 'add' -- properly, I believe. Yet
'$a++;' is silent. How peculiar!
Can anyone explain or justify the absence of a warning for '$a++;'?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 05 Dec 1998 08:28:25 GMT
From: jlhughes@pobox.com
Subject: newbie question searching string with =~
Message-Id: <74aqr7$t8k$1@nnrp1.dejanews.com>
I'm trying to search a file and print out each line that contains a string
that the user has input using STDIN.
The script below only works if the the string input with STDIN is at the end
of the line in the file. Otherwise, no lines match.
What do I need to change to make the search find strings anywhere in the line?
[--start script example--]
#!/d:/perl5/bin/perl.exe
# open the log for reading
open (LOGFILE, "d:/perl5/samples/dec4log");
# each line becomes variable
@fileinput = <LOGFILE>;
#close the log file
close (LOGFILE);
#count the lines in the file
print "There are $#fileinput lines in the log.\n";
#get search term
print "Enter search term: ";
$FindThis = <STDIN>;
#read line by line through logfile for search term
for ($i = 0; $i <= $#fileinput; $i++) {
if ($fileinput[$i] =~ $FindThis) {
print "$fileinput[$i]\n";
}
}
[--end script example--]
--
http://come.to/digital_art_desktops
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 5 Dec 1998 08:50:36 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: newbie question searching string with =~
Message-Id: <slrn76hsus.581.sholden@pgrad.cs.usyd.edu.au>
On Sat, 05 Dec 1998 08:28:25 GMT, jlhughes@pobox.com <jlhughes@pobox.com> wrote:
>I'm trying to search a file and print out each line that contains a string
>that the user has input using STDIN.
>
>The script below only works if the the string input with STDIN is at the end
>of the line in the file. Otherwise, no lines match.
Sounds like you forgot to chomp...
>
>What do I need to change to make the search find strings anywhere in the line?
>
>
>[--start script example--]
>
>#!/d:/perl5/bin/perl.exe
Turning on warnings with -w is a good idea... especially if you are having
problems...
>
># open the log for reading
>open (LOGFILE, "d:/perl5/samples/dec4log");
You should always check the return value of open....
open (LOGFILE, "d:/perl5/samples/dec4log") || die "Unable to open logfile: $!";
># each line becomes variable
>@fileinput = <LOGFILE>;
>#close the log file
What a space wasting completely useless comment...
>close (LOGFILE);
>
>#count the lines in the file
>print "There are $#fileinput lines in the log.\n";
>
>#get search term
>print "Enter search term: ";
>$FindThis = <STDIN>;
>
>#read line by line through logfile for search term
> for ($i = 0; $i <= $#fileinput; $i++) {
> if ($fileinput[$i] =~ $FindThis) {
> print "$fileinput[$i]\n";
> }
> }
Bingo.. no chomp...
I suspect that what you really want is to chomp $FindThis so that the new line
on the end doesn't intergere with the matches...
Which would explain why it matches at the end - since your asking it to match
a new line character and by definition that can only occur at the end of a
line...
--
Sam
"... the whole documentation is not unreasonably transportable in a
student's briefcase." - John Lions describing UNIX 6th Edition
"This has since been fixed in recent versions." - Kernighan & Pike
------------------------------
Date: Fri, 4 Dec 1998 21:21:47 -0800
From: "Bart Wical" <bart.wical@lmco.com>
Subject: Perl or Perl Script on PWS on Win95
Message-Id: <74afun$1g61@svlss.lmms.lmco.com>
I have no problem running PWS on NTW with script maps but cannot on win95.
Perl works @ the command prompt and explorer.
here is my reg export
REGEDIT4
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters\Scrip
t Map]
".pl"="c:\\perl\\bin\\perlls.exe %s %s"
".pls"="c:\\perl\\bin\\perl.exe %s %s %s"
".bat"="command.com %s"
Any Clues .pls and .pl do not work.
------------------------------
Date: Fri, 04 Dec 1998 20:31:19 -0800
From: metalmd@earthlink.net (Marc)
Subject: Re: perlshop 3.1
Message-Id: <metalmd-0412982031200001@pool039-max11.ds26-ca-us.dialup.earthlink.net>
In article <3668ab81.8526400@news.cci-internet.com>,
chubbys@cci-internet.com (Steve) wrote:
> I have had the same problem. Perlshop installed perfectly on one site
> but when I tried to use it on 2 other locations (using the same setup)
> I received the same Invalid Transmission #3 error from my IP address.
> Suspect problem is related to version of Perl being run on the server
> but dont know for sure. Hope somebody has an answer because it is
> a great program.
Did the two servers where the script did not work, have a virtual domain,
and the one that did work, not have the virtual domain? Someone said that
a virtual domain can lead to problems, although they didn't elaborate.
Marc
------------------------------
Date: Sat, 05 Dec 1998 04:53:52 GMT
From: chubbys@cci-internet.com (Steve)
Subject: Re: perlshop 3.1
Message-Id: <3668bc4f.12828992@news.cci-internet.com>
On Fri, 04 Dec 1998 20:31:19 -0800, metalmd@earthlink.net (Marc)
wrote:
>In article <3668ab81.8526400@news.cci-internet.com>,
>chubbys@cci-internet.com (Steve) wrote:
>
>
>> I have had the same problem. Perlshop installed perfectly on one site
>> but when I tried to use it on 2 other locations (using the same setup)
>> I received the same Invalid Transmission #3 error from my IP address.
>> Suspect problem is related to version of Perl being run on the server
>> but dont know for sure. Hope somebody has an answer because it is
>> a great program.
>
>Did the two servers where the script did not work, have a virtual domain,
>and the one that did work, not have the virtual domain? Someone said that
>a virtual domain can lead to problems, although they didn't elaborate.
>
>Marc
>
Yes, the 2 sites that did not work are virtual domains and the one
that does work is not. However, on one of the virtual domain sites
Perlshop was running for about a month before I started receiving
the transmission error #3.
Steve
------------------------------
Date: Fri, 04 Dec 1998 22:35:17 -0800
From: Adam Sweeney <asweeney@cisco.com>
To: bravo <rainman@dustyhoffman.com>
Subject: Re: Problem with seek.....
Message-Id: <3668D425.F6DA6F8D@cisco.com>
bravo wrote:
> What I want to do is append it to the top so the most recent info is on top.
>
> I am using the following code in my script.
>
> open(OUTF,">>data.txt");
Giving the '>>' to the open will cause perl to open the file
with 'a' option to fopen(). This will usually turn into the
O_APPEND flag being passed to the actual open() system
call. Once this happens, any writes you do to the file will
go to the end of the file no matter what you do with seek().
Adam
------------------------------
Date: Fri, 04 Dec 1998 22:02:42 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Recipe Database for Unix
Message-Id: <3668B062.59B6E4B@technologist.com>
Try the one I have at http://webreview.com
Go to my site at: http://www.inlink.com/~perlguy/simple and click on the
link to "version 1.1" of the database. It is very customizable and real
easy to set up.
Good luck!
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Fri, 04 Dec 1998 22:15:28 -0800
From: Adam Sweeney <asweeney@cisco.com>
Subject: Re: Sorting VERY large files effeciently
Message-Id: <3668CF80.E9D0E80E@cisco.com>
Unless someone has recently added the support, you may
have trouble accessing files greater than 2 GB - 1 bytes in
size from perl. You'll need perl to use stat64() to be able
to determine the size of the file, and on some systems you
won't be able to open the file unless perl passes the
O_LARGEFILE flag to open().
Of course, if you're willing to always break your data into
files smaller than 2 GB, the above won't be an issue.
Adam
Clinton Pierce wrote:
> [Courtesy CC sent to poster in E-Mail]
>
> On Wed, 02 Dec 1998 15:48:14 GMT, andy-markham@mindspring.com wrote:
> >I have recently started working with a group that does some work on an
> >HP3000. Since there is a 4GB limit on that machine, they have to find a new
> >way to do some effecient sorting of data files that exceed that limit. They
> >have been looking at a couple of packages on HPUX to do the job, CoSORT
> >(~$2K) and something else that is on the order of $20K. It turns out that
> >CoSORT can't handle it, so they are thinking about writing a $20K check to
> >solve the problem.
> >
> >My first thought is, can't Perl be used to sort a really large flat file in
> >an effecient manner? Hell, Perl can do everything else I've ever asked it to
> >do...
> >
> >I don't plan on writing and testing out a bunch of sort routines, so
> >basically I'm hoping that someone on this group has already tackled this
> >problem and has a really good response. I'd really like for us to find a
> >solution in Perl, but if we end up having to write the check, so be it.
> >
> >So, is Perl up to the task? Please say YES!
------------------------------
Date: 05 Dec 1998 04:56:56 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Threads and Perl?
Message-Id: <912833809.556525@thrush.omix.com>
otis@my-dejanews.com wrote:
: looking for thread* & perl in Dejanews wasn't very useful, so I was wondering
: if anyone here could tell me what exactly is the current status of threads in
: perl. Are there modules that implement threads, or should I get the latest
: (developers' ?) version of perl instead of the latest perl for the masses?
:
: I can deal with beta material, I just need it for some little scripts, nothing
: big.
See README.threads in the distribution. You'll also be well advised
to keep an eye on the Perl5 Porters mailing list. -See
language.perl.com for info.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 05 Dec 1998 05:05:44 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Tool to reverse engineer perl code
Message-Id: <912834337.124861@thrush.omix.com>
drkeith@bway.net wrote:
: I was just searching for the same thing -- a tool for analyzing perl
: application -- required files, sub-routines & data members, inputs, outputs,
: etc & generating HTML documentation a la javadoc. Anything exist already?
: I've seen debuggers, but I'm wanting to document working apps.
>snip<
What you're asking for is nearly impossible. Perl is simply too
dynamic of a language for much of any of that.
perldoc perldoc
Perldoc allows a more flexible system to javadoc, that takes into
account Perl's massively dynamic constructs.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 5 Dec 1998 07:13:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Understanding the debugger
Message-Id: <74ame3$mnh$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Philip King
<pking@pdq.net>],
who wrote in article <36686717.A228515F@pdq.net>:
> I am interested in understanding the internals of the Perl debugger (the
> one shipped standard, and invoked with perl -d.) I have found the
> debugger most useful in understanding the code of other utilities, and
> was wondering if anyone knows of a way to invoke the debugger on the
> debugger.
>
> In other words, is there is a way to use the debugger, to step through
> the code of the debugger, which happens to be stepping through a
> most-likely "toy" program???
So you want: at each breakable point of the "toy" program a call to
the level-1-debugger'a DB::DB() is made, and at each breakable point of
the level-1-debugger a call to the level-2-debugger'a DB::DB() is
made?
If you need this, you need to change the code for pp_dbstate() in
pp_ctl.c. Fortunately, it is a very simple function, and I'm sure you
can easily do this.
Please report your results.
Ilya
P.S. I think a more profitable way to learn how the debugger works is
to write micro-debuggers yourself, as recommended in perldebug.pod.
------------------------------
Date: Sat, 05 Dec 1998 06:33:51 GMT
From: pinoy@w-link.net (geekman)
Subject: using exec cmd
Message-Id: <74ak5a$hrm$1@sparky.wolfe.net>
Cheers:
does anyone know if it's possible to use <!--#exec cmd --> in a perl
script.. I've used the \ esc char to make the script read this line.
but no ouput from the cmd.. any help appredicated
------------------------------
Date: Sat, 05 Dec 1998 04:56:57 +0100
From: Steven Sagaert <Steven.Sagaert@cdc.com>
Subject: What I would like to see in the next major release of Perl
Message-Id: <3668AF09.D9181A94@cdc.com>
Hi All,
I like Perl a lot and use it daily to develop little to medium sized
applications. However when the applications grow larger and more complex
I find developing in Perl becoming less and less attractive. What I
miss in perl is decent support for Object Orientation. Ok, you can do OO
in perl as is demonstrated by all those modules in the CPAN, but the way
that perl does OO now is just a " quick fix" to perl so that people
could do OO. It's not clean, elegant and some features of OO are
missing: namely: classes and encapsulation(=data hiding). Right now the
lack of data hiding makes that programmers are not forced to use methods
but just can directly the objects attributes which doesn't promote code
reuse.
The lack of a class definition which is very handy to directly see which
attributes a class has, makes that one is obliged to scrutinise the
implementation of the constructor (commonly called 'new') to find out
which attributes a class has.
What I also really miss is structured exception handling. The checking
of return codes and/or $! just really messes up your normal processing
code with if statements meant for handling errors/exception. In
structured (object oriented) exception handling the normal code and the
error handling code are strictly separated and also there's no more
mixing of real data and error codes in the values that functions return.
A class definition in perl could look like this:
class example: parentclass1, parentclass2
{
attributes:
$att1,@att2,%att3, static $att4, static $att5=12;
methods:
sub meth1
{ some code here }
private sub meth2
{ some code here }
static sub meth3
{ some code here }
};
This means the following:
* the class example is derived from the classes parentclass1 and
parentclass2.
* the attributes are all private, i.e. they cannot be accessed directly
in application code. They can be accessed as $att1 or $self->att1 in the
method definitions.
* static attributes (or class attributes) are shared by all class
instances (object), i.e. the attribute has the same value for all
objects.
*methods are by default public. If you don't want them to be accesible
in the application code you have to specify them as 'private'.
*static methods don't need an object to be called but can be called as
CLASSNAME->METHODNAME(...,...,...); Look up static methods in the java
language for more info on this.
*objects are constructed as follows: $obj=new example(12,"lala",$par);
or $obj=example->new(12,"lala",$par);
*methods are called as follows: $obj->meth1($par);
exception handling should be basically the same as in Java or Python
i.e.
try
{
normal processing code
exceptions are generated either by the system or by the programmer.
exeptions are generated by the programmer as follows: throw new
exceptionClass1("this is an exception");
}
catch(exceptionClass1 e)
{
handle exceptionClass1 exeptions e here
}
catch(exceptionClass2 e)
{
handle exceptionClass2 exeptions e here
}
finally()
{
this block is always executed => place clean up code here
}
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4363
**************************************