[17051] in Perl-Users-Digest
Perl-Users Digest, Issue: 4463 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 28 18:15:41 2000
Date: Thu, 28 Sep 2000 15:15:21 -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: <970179321-v9-i4463@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 28 Sep 2000 Volume: 9 Number: 4463
Today's topics:
Re: Questions about space-saving techniques (James Weisberg)
Re: Questions about space-saving techniques <lr@hpl.hp.com>
Re: recommended link checking script? mikelot@my-deja.com
registry question with perl... <boogiemonster@usa.net>
Re: Rounding Numbers... <tim@ipac.caltech.edu>
Re: Rounding Numbers... <dukman821@yahoo.com>
rtf parser <celliot@tartarus.uwa.edu.au>
Re: rtf parser <randy@theoryx5.uwinnipeg.ca>
Re: Salary Range for Perl Programmers <gellyfish@gellyfish.com>
Re: Salary Range for Perl Programmers <gellyfish@gellyfish.com>
Re: sendmail <gellyfish@gellyfish.com>
Re: SIGALRM with NT stilgar_too@my-deja.com
Re: Sorry - TOTAL newbie <tim@ipac.caltech.edu>
Re: splitting lines with a regex <godzilla@stomp.stomp.tokyo>
Re: splitting lines with a regex <jeffp@crusoe.net>
Re: splitting lines with a regex <godzilla@stomp.stomp.tokyo>
telnet, ftp module hao7@yahoo.com
What could this mean? (Enchanted)
Re: What could this mean? <tony_curtis32@yahoo.com>
Re: What could this mean? <srame@excite.no.spam.no.com>
Re: What does this do?! (Gwyn Judd)
wrong value passed to text box <iznunyabidnes@home.here>
Re: wrong value passed to text box <jeffp@crusoe.net>
Re: wrong value passed to text box <jeff@vpservices.com>
Re: wrong value passed to text box <iznunyabidnes@home.here>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 Sep 2000 19:49:44 GMT
From: chadbour@wwa.com (James Weisberg)
Subject: Re: Questions about space-saving techniques
Message-Id: <shNA5.5671$l35.134620@iad-read.news.verio.net>
In article <MPG.143d224eb798330098add0@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <usKA5.5654$l35.133134@iad-read.news.verio.net> on Thu, 28
>Sep 2000 16:36:42 GMT, James Weisberg <chadbour@wwa.com> says...
>> If you're interested, I could use a suggestion on how to take a
>> typical packstring like: (LCCCaCaCCaCaCaaaaaaaaaaCCCaaaaaCCCaaaaaC)
>> and turn that into (LC3aCaC2aCaCa10C3a5C3a5C). Just as an exercise
>> in efficiency, it would be interesting to see how different Perl
>> hackers write that operation.
>
>More people would see your challenge were it not buried amidst a 186-
>line post.
>
> s/(([A-Za-z])\2+)/$2 . length $1/eg
Yes, well I was fully prepared to issue a less wordy challenge
and then respond with a 186-line post for why I needed it!
Though, now I have a problem resultant from this packstring
contraction which I don't understand. I can best demonstrate with
a simple example:
[ccs2 288] /tmp # -> cat packtest.pl
#!/usr/local/bin/perl -w
use diagnostics;
$"=","; # set array separator for output.
my @a = ("a") x 10;
my $packstr = shift;
my $packlen = length($packstr);
my $s = pack($packstr, @a);
my @r = unpack($packstr, $s);
print "a-packstr [$packlen]: ($packstr)\n";
print "a [$#a]: (@a)\n";
print "r [$#r]: (@r)\n";
[ccs2 289] /tmp # -> ./packtest.pl "aaaaaaaaaa"
a-packstr [10]: (aaaaaaaaaa)
a [9]: (a,a,a,a,a,a,a,a,a,a)
r [9]: (a,a,a,a,a,a,a,a,a,a)
[ccs2 290] /tmp # -> ./packtest.pl "a10"
a-packstr [3]: (a10)
a [9]: (a,a,a,a,a,a,a,a,a,a)
r [0]: (a)
Why does my @r array not get fully expanded by the "a10" packstring
with unpack? It certainly works if I stuff my array with 1's instead of
a's and use a packstring of "i10" instead of "a10".
To put this back into context, my function:
sub dbrec_compress {
my $packstr = "";
for (@_) {
if (! defined $_ )
{ $_ = '';
$packstr .= 'a'}
elsif ( $_ < 0 )
{ die "Negative field record $_ not permitted in db.\n")}
elsif ( $_ < 256 )
{ $packstr .= 'C'}
elsif ( $_ < 65536 )
{ $packstr .= 'S'}
elsif ( $_ < 4294967296)
{ $packstr .= 'L'}
else { die "Field record $_ too large to pack.\n")}
}
$packstr =~ s/(([A-Za-z])\2+)/$2 . length $1/eg;
my $packlen = length($packstr);
return pack("Ca$packlen$packstr", $packlen, $packstr, @_);
}
is using your substition directive to turn the packstring:
(LCCCaCaCCaCaCaaaaaaaaaaCCCaaaaaCCCaaaaaC) to (LC3aCaC2aCaCa10C3a5C3a5C).
The problem, is that unpack isn't giving me back 10 ''s when I uncompress
the record string. What's up with that?
--
World's Greatest Living Poster
------------------------------
Date: Thu, 28 Sep 2000 13:50:54 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Questions about space-saving techniques
Message-Id: <MPG.143d4f0c27bd52f398add4@nntp.hpl.hp.com>
In article <shNA5.5671$l35.134620@iad-read.news.verio.net> on Thu, 28
Sep 2000 19:49:44 GMT, James Weisberg <chadbour@wwa.com> says...
> In article <MPG.143d224eb798330098add0@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >In article <usKA5.5654$l35.133134@iad-read.news.verio.net> on Thu, 28
> >Sep 2000 16:36:42 GMT, James Weisberg <chadbour@wwa.com> says...
> >> If you're interested, I could use a suggestion on how to take a
> >> typical packstring like: (LCCCaCaCCaCaCaaaaaaaaaaCCCaaaaaCCCaaaaaC)
> >> and turn that into (LC3aCaC2aCaCa10C3a5C3a5C). Just as an exercise
> >> in efficiency, ...
...
> > s/(([A-Za-z])\2+)/$2 . length $1/eg
>
> Yes, well I was fully prepared to issue a less wordy challenge
> and then respond with a 186-line post for why I needed it!
Only 86 lines this time. :-)
> Though, now I have a problem resultant from this packstring
> contraction which I don't understand.
...
> Why does my @r array not get fully expanded by the "a10" packstring
> with unpack? It certainly works if I stuff my array with 1's instead of
> a's and use a packstring of "i10" instead of "a10".
...
> is using your substition directive to turn the packstring:
> (LCCCaCaCCaCaCaaaaaaaaaaCCCaaaaaCCCaaaaaC) to (LC3aCaC2aCaCa10C3a5C3a5C).
> The problem, is that unpack isn't giving me back 10 ''s when I uncompress
> the record string. What's up with that?
What's up is that I unhelpfully didn't consider the semantics of your
request, and dealt with it only as a syntactic exercise. In fact, as
you discovered, the semantics of 'a10' and 'i10' or 'C10' are quite
different. For 'a' it is a length; for the others it is a 'repeat
count'.
From `perldoc -f pack`:
Each letter may optionally be followed by a number giving a repeat
count. With all types except a, A, Z, b, B, h, H, and P the pack
function will gobble up that many values from the LIST. ...
...
The a, A, and Z types gobble just one value, but pack it as a string
of length count, padding with nulls or spaces as necessary.
You can adjust my regex by removing specific format types from the
character class or being explicit about the ones you want compressed.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 28 Sep 2000 20:29:40 GMT
From: mikelot@my-deja.com
Subject: Re: recommended link checking script?
Message-Id: <8r09n8$m2e$1@nnrp1.deja.com>
Thanks, I'll check out your latest as well!
just as an fyi, if you ever want to support a graphical view (ie
diagram of nodes visited), check out this general purpose tool from
AT&T:
http://www.research.att.com/sw/tools/graphviz/
It's pretty easy to create data in the format it expects from a Perl
script, and have it draw a network diagram of it for you. I've used it
before to graphically "see" hotspots in a network of links...
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 28 Sep 2000 14:33:54 -0700
From: "J Joseph Yusko" <boogiemonster@usa.net>
Subject: registry question with perl...
Message-Id: <8r02uf$hbq$1@usenet01.srv.cis.pitt.edu>
I'm trying to create a script that locates a remote machine and modify a
certain registry for a specific machine. The sample code will display one
of the directory with serviceroot but will not even try the if statment with
softwareroot variable.
can anyone help me out with this one?
use Win32::Registry;
%KeyName = (
softwareroot => 'Software\Folio\4',
serviceroot => 'System\CurrentControlSet\Services',
);
$Root = $HKEY_LOCAL_MACHINE;
if( $Machine = $ARGV[0] )
{
$HKEY_LOCAL_MACHINE->Connect( $Machine, $Root ) || die "Could not
connect to the registry on '$Machine'\n";
}
if( $Root->Open( $KeyName{softwareroot}, $SoftwareRoot ) )
{
if( $SoftwareRoot->Open( $KeyName{foliosubdirectory}, $Links ) )
{
print "$SoftwareRoot opened\n";
}
$SoftwareRoot->Close();
}
if( $Root->Open( $KeyName{serviceroot}, $ServiceRoot ) )
{
print "'$ServiceRoot' found\n";
}
$ServiceRoot->Close();
------------------------------
Date: Thu, 28 Sep 2000 11:10:35 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Rounding Numbers...
Message-Id: <39D3899B.D9152E74@ipac.caltech.edu>
Lou Moran wrote:
>
> --I have looked in perldoc, but I'm not very god at it yet... viva la
> html in activestate... anylou...
>
> --I don't want any rounding on numbers. even if the number is
> 9.999999 I want it to be 9, not 10.
>
> --how? or better, where?
Well, oddly,
perdoc -q round
gives you the answer in the first line: "Remember that int() merely truncates
toward 0."
How's that for documentation!
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Thu, 28 Sep 2000 18:05:33 GMT
From: Donald <dukman821@yahoo.com>
Subject: Re: Rounding Numbers...
Message-Id: <8r0195$e6e$1@nnrp1.deja.com>
In article <36u6tss5tkosbfnu0hho5ctk0s767pkbj4@4ax.com>,
Lou Moran <lmoran@wtsg.com> wrote:
> --I have looked in perldoc, but I'm not very god at it yet... viva la
> html in activestate... anylou...
>
> --I don't want any rounding on numbers. even if the number is
> 9.999999 I want it to be 9, not 10.
>
> --how? or better, where?
>
> Registered Linux user number 187055
>
What currently are you doing that is causing a # to round? A #
shouldn't round unless you are causing it to do so w/ a function or
something.
- Donald
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 29 Sep 2000 04:54:40 +0800
From: "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
Subject: rtf parser
Message-Id: <39d3b046$0$7897@echo-01.iinet.net.au>
Does anyone know of any perl scripts that can read rtf files and pull out
table information etc?
------------------------------
Date: 28 Sep 2000 21:15:45 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: rtf parser
Message-Id: <8r0ce1$b51$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, Cameron Elliott <celliot@tartarus.uwa.edu.au> wrote:
> Does anyone know of any perl scripts that can read rtf files and pull out
> table information etc?
Hi,
Try doing a search at http://search.cpan.org/ or
http://theoryx5.uwinnipeg.ca/CPAN/cpan-search.html for
'rtf' - perhaps something that comes up there can do
what you want.
best regards,
randy kobes
------------------------------
Date: 27 Sep 2000 21:51:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Salary Range for Perl Programmers
Message-Id: <8qtml6$6oh$1@orpheus.gellyfish.com>
On Wed, 27 Sep 2000 08:28:23 -0500 Russ Jones wrote:
> Uri Guttman wrote:
>>
>>
>> using the wrong names and terms reflects poorly on the course and
>> instructor. that implies the rest of the course may be lousy as well.
>>
>> same line of thought: any book with perl5 in the title sucks. there is no
>> perl5, just perl. try to find a decent book with perl5 in the
>> title. good luck.
>>
>
> (Please note: I do not use smiley faces, I'm not that cute. Some
> segments included here might be intended to be ironic, if not
> downright sarcastic. Please try to keep that in mind before you get
> your drawers twisted up around your neck.)
>
Can't be arsed chum - bye bye.
*plonk*
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Sep 2000 21:55:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Salary Range for Perl Programmers
Message-Id: <8qtmsu$6os$1@orpheus.gellyfish.com>
On Wed, 27 Sep 2000 10:55:14 +0100 Nicolas MONNET wrote:
> What the fuck was Tom Briles <sariq@texas.net> trying to say:
>
>> Any class that allows its students to leave calling 'Perl' 'PERL' isn't
>> worth two cents, much less four hundred bucks.
>
> It's spelled A-N-A-L R-E-T-E-N-T-I-V-E.
>
Its spelt K-I-L-L-F-I-L-E actually.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Sep 2000 22:12:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: sendmail
Message-Id: <8qtnsg$6qc$1@orpheus.gellyfish.com>
On Wed, 27 Sep 2000 02:14:06 -0400 ldbarlet wrote:
> "Andrew N. McGuire " <anmcguire@ce.mediaone.net> wrote in message
> news:Pine.LNX.4.21.0009261323500.17425-100000@hawk.ce.mediaone.net...
>> On Tue, 26 Sep 2000, ldbarlet quoth:
>>
>> l> Can anyone point me in the right direction to learn how to use
>> l> sendmail to send email in html format?
>>
>> I do not know what on earth you would post this in a Perl newsgroup
>> for, but sendmail will deliver email in HTML format without any
>> modifications, you just have to have an MUA capable of rendering it.
>
> My apologies but I wasn't as specific as I thought I need be. I am
> using a cgi script to send email, I wanted to know if someone could
> point me in the right direction on where to find info on how to write
> the correct code in the script to send the mail in html format.
>
You were specific enough. If you need help with using some mail
program then you should ask in a group specific to that mail program.
If you have some problem with a mail protocol then you should ask
in a group specific to that mail protocol. If you believe that some
facility might be implemented in Perl then you should check out CPAN
<http://search.cpan.org> or perhaps search Deja News for a similar question
to yours <http://www.deja.com>.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Thu, 28 Sep 2000 19:51:46 GMT
From: stilgar_too@my-deja.com
Subject: Re: SIGALRM with NT
Message-Id: <8r07ge$jvq$1@nnrp1.deja.com>
In article <MPG.143d3396997828ee9897d0@localhost>,
jason <elephant@squirrelgroup.com> wrote:
> go and read the documentation .. then you'll see the unsupported
> functions - and where applicable - the workarounds for getting
> similar functionality
>
> assuming you're using the standard ActiveState Perl the documentation
> has been converted to lovely HTML and there's a shortcut to it on
> your Programs menu
>
> --
> jason -- elephant@squirrelgroup.com --
>
I'd also like to know the answer to this. I've been looking through
the perl docs on the activestate site for about 45 minutes now and
still haven't found the workarounds. Can you be more specific please?
This is the closest "answer" I could find...(from the FAQ)
Why doesn't signal handling work on Windows?
Signals are unsupported by the Win32 API. The C Runtime provides
crude support for signals, but there are serious caveats, such as
inability to die() or exit() from a signal handler. Perl itself does
not guarantee that signal handlers will not interrupt critical
operations such as memory allocation, which means signal invocation
may throw perl internals into disarray. For these reasons, signals
are unsupported at this time.
I don't consider avoiding signal traping a workaround :)
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 28 Sep 2000 11:05:37 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Sorry - TOTAL newbie
Message-Id: <39D38871.AA91835D@ipac.caltech.edu>
eyedunno wrote:
[Quoted material compressed]
> Sorry about this but could somebody please take 3 seconds to show
> me how to write this in Perl
> --------------------------------
> mystr$ = "heres a short one"
> for i = 0 to len(mystr$) step 2
>
> I've tried
> -------------------------------
> open (MYFILE, "myfile.txt");
> my @myfile = <MYFILE>;
> close (MYFILE);
> for ( $i = 0; $i <= $#myfile; $i=$i+2 ) { ....}
a) Heed the suggestions of the other responders.
b) Your code steps through the *lines* by twos. Do you mean you wish to
step through the characters of the string formed by each line by 2's?
If so...
my $mystr = "heres a short one";
for (my $i=0; $i<length($mystr); $i+=2) {
print substr($mystr,$1,1)."\n";
}
Now read perlstyle and make it look like Perl instead of C.
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Thu, 28 Sep 2000 12:29:19 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: splitting lines with a regex
Message-Id: <39D39C0F.9299BA7D@stomp.stomp.tokyo>
Alex Hart wrote:
> I have text coming in from an email. Sometimes the text contains
> carriage returns, and sometimes not. I want to split up the lines into
> pieces that can easily fit on the screen. I figure that 60 chars or so
> is safe, but 80 might be OK too. What I'd like to do is split the line
> at 60 characters (at the next space at least), unless there's a \n
> within 80 characters (from the beginning.).
> This is how I do it now :
> $email_body =~ s/\n|(.{60}.*?\s)/$1\n/g; # puts a \n at the first space
> after 60 characters
> but with this I get stuck with a lot of 2 word lines when there is a \n
> at character 75. How can I have it look ahead to see if there is a \n
> within 20 characters before splitting the line. Thanks.
This can be accomplished without use of a module if you are
willing to invest time, effort and ample planning into an
imaginative script. Avoiding use of a module will help to
keep your script memory usage to a minimum and help to keep
your script fast. However, there are challenges.
My test script below exemplifies a basic premise of how
this is done. It is not a script which will do everything
perfectly, but is a script which can be enhanced to meet
your goal with near perfection, if you plan well.
This script will not remove html like tags. This can be
added via a regex. It will not recognize block quote
type styles and, like removing html, this feature can
be added in without too much difficulty. Paragraph breaks
by two \n are caught, but not more than two. This could
be changed easy enough. My script will exhibit some oddities
related to a substring of short words, or a substring of
long words. This script plays the averages; the typical
length of an average word.
I have setup my second paragraph to display one of these
challenges based on a long word and premature truncation.
However, with good usage of if conditionals establishing
ranges of line length and appropriate script action, this
challenge can be overcome.
This is a bare bones skeleton script upon which you can
build, from which you can develop concepts or simply
realize, what you ask is not an easy task although it
can be done without use of a module. It's just a matter
of how well you think and, your level of programming skill.
It's all a matter of playing the numbers well, and winning.
Godzilla!
--
Kira, Professional Poker Player
http://la.znet.com/~callgirl/android/poker.cgi
TEST SCRIPT:
____________
#!/usr/local/bin/perl
print "Content-type: text/plain\n\n";
$input = "Now is the time for all obsessive
Techno-Geeksters to come to the aid of their
lame brain glossy black jack boot wearing
cabal in impotent defense against Godzilla
and her onslaught of booger bombs, snot rockets,
slime grenades, slippery semantics and
satirical commentaries.
It is also the time for obsessive Techno-Geeksters
to kneel and pray before their alter of Perl Perl God,
this formidable foe, Godzilla, does not use her ultimate
weapon of mind destruction, Socratic Irony.";
$input =~ s¡\n\n¡¿¡g;
$input =~ s¡\s+¡ ¡g;
$input =~ s¡ \n¡ ¡g;
$input =~ s¡\n ¡ ¡g;
$input =~ s¡\n([a-z])¡ $1¡gi;
$input =~ s¡\n¡¡g;
$input =~ s¡¿¡\n\n¡g;
do
{
if (length ($input) < 80)
{
$input =~ s¡^\s+¡¡;
print $input;
$input = "";
}
else
{
if (length (substr ($input, 0, (index ($input, " ", 60)))) < 80)
{
$line = substr ($input, 0, (index ($input, " ", 60)), "");
$line =~ s¡^\s+¡¡;
print "$line\n";
}
else
{
$line = substr ($input, 0, (index ($input, " ", 50)), "");
$line =~ s¡^\s+¡¡;
print "$line\n";
}
}
}
until (!($input));
exit;
PRINTED RESULTS:
________________
Now is the time for all obsessive Techno-Geeksters to come to
the aid of their lame brain glossy black jack boot wearing cabal
in impotent defense against Godzilla and her onslaught of booger
bombs, snot rockets, slime grenades, slippery semantics and
satirical commentaries.
It is also the time for obsessive Techno-Geeksters
to kneel and pray before their alter of Perl Perl God, this
formidable foe, Godzilla, does not use her ultimate weapon of
mind destruction, Socratic Irony.
------------------------------
Date: Thu, 28 Sep 2000 16:20:33 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: splitting lines with a regex
Message-Id: <Pine.GSO.4.21.0009281557570.5957-100000@crusoe.crusoe.net>
On Sep 28, Godzilla! said:
>Alex Hart wrote:
>
>> I have text coming in from an email. Sometimes the text contains
>> carriage returns, and sometimes not. I want to split up the lines into
>> pieces that can easily fit on the screen. I figure that 60 chars or so
>> is safe, but 80 might be OK too. What I'd like to do is split the line
>> at 60 characters (at the next space at least), unless there's a \n
>> within 80 characters (from the beginning.).
>
>This can be accomplished without use of a module if you are
>willing to invest time, effort and ample planning into an
>imaginative script. Avoiding use of a module will help to
>keep your script memory usage to a minimum and help to keep
>your script fast. However, there are challenges.
I don't see why you don't just use a format.
#!/usr/bin/perl
$string = << 'END';
I think that Godzilla should put an
end to her incredibly obtuse, and
often off-topic, metaphors and such.
Clouding an explanation with useless
rhetoric is not helpful, especially
to new users to the newsgroup.
END
$newstr = format_string($string, 60);
sub format_string {
my ($str, $len) = @_;
local $^A;
formline('^' . ('<' x --$len) . '~~', $str);
return $^A;
}
__END__
If this does not produce the proper output, oops on me.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Thu, 28 Sep 2000 13:47:01 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: splitting lines with a regex
Message-Id: <39D3AE45.61565109@stomp.stomp.tokyo>
Jeff Pinyan wrote:
> Godzilla! wrote:
> >Alex Hart wrote:
> I don't see why you don't just use a format.
> #!/usr/bin/perl
> $string = << 'END';
> I think that Godzilla should put an
> end to her incredibly obtuse, and
> often off-topic, metaphors and such.
> Clouding an explanation with useless
> rhetoric is not helpful, especially
> to new users to the newsgroup.
> END
> $newstr = format_string($string, 60);
> sub format_string {
> my ($str, $len) = @_;
> local $^A;
> formline('^' . ('<' x --$len) . '~~', $str);
> return $^A;
> }
>
> __END__
>
> If this does not produce the proper output, oops on me.
I don't use this style for two very good reasons. Your
style affords no explanation and no learning potential.
No fundamental concepts are displayed, only symbology.
A reader is left with a task of figuring out what your
Perl 5 Egyptian Hierogylphics mean and do. A reader
is also left with trying to figure out my second good
reason; your script produces zero output. It does not
work. I would say these are both rather valid reasons.
I am here to help others learn. You, like all Perl 5
Cargo Cultists, are here to masturbate your ego with
selfish disregard for the principle of newsgroups;
helping each other through sharing of knowledge.
I love technological slippery semantics.
You have made a stereotypical Perl 5 Cargo Cultist
assumption; all readers use a command line screen.
Most average readers off the cyber-street, do not.
...opps on you and your fellow Perl 5 Cargo Cultists.
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
TEST SCRIPT:
___________
#!/usr/local/bin/perl
print "Content-type: text/plain\n\n";
$string = << 'END';
I think that Godzilla should put an
end to her incredibly obtuse, and
often off-topic, metaphors and such.
Clouding an explanation with useless
rhetoric is not helpful, especially
to new users to the newsgroup.
END
$newstr = format_string($string, 60);
sub format_string {
my ($str, $len) = @_;
local $^A;
formline('^' . ('<' x --$len) . '~~', $str);
return $^A;
}
__END__
PRINTED RESULTS:
________________
"Document contains no data.
Try again later or contact server's administration."
------------------------------
Date: Thu, 28 Sep 2000 18:16:39 GMT
From: hao7@yahoo.com
Subject: telnet, ftp module
Message-Id: <8r01tt$eob$1@nnrp1.deja.com>
Hi all,
I am using perl on the Solaris 2.6 box and there are no modules for
telnet or ftp. I want to put some files from a client to a server
machine. Suppose, that i can not install ftp or telnet modules on this
Solaris server, is there another way to do it? Can we use system
command like "system(cp "a", "b");" as a substitution for using perl
copy modules? Thanks a lot.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 28 Sep 2000 21:47:40 GMT
From: no@spam.com (Enchanted)
Subject: What could this mean?
Message-Id: <39d3ba86.778135800@news.attcanada.net>
At the very end of my perl script, I'm getting this generated to
STDERR (runs on FreeBSD)
21.098u 0.195s 0:48.40 43.9% 10+7145k 46+149io 0pf+0w
One wild guess I have is that I may have some illegal division
somewhere or something but if you look at it, it looks like it means
something.
Anyone have an idea what, or advice on how to investigate further?
(and why it appears)
Enchanted
------------------------------
Date: 28 Sep 2000 16:52:13 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: What could this mean?
Message-Id: <87lmwcfalu.fsf@limey.hpcc.uh.edu>
>> On Thu, 28 Sep 2000 21:47:40 GMT,
>> no@spam.com (Enchanted) said:
> At the very end of my perl script, I'm getting this
> generated to STDERR (runs on FreeBSD)
> 21.098u 0.195s 0:48.40 43.9% 10+7145k 46+149io 0pf+0w
That's looks as if it's from some kind of a "time"
command. Might be your shell doing it?
hth
t
--
Namaste!
And an "oogabooga" to you too!
-- Homer Simpson
------------------------------
Date: Thu, 28 Sep 2000 15:55:09 -0600
From: srame <srame@excite.no.spam.no.com>
Subject: Re: What could this mean?
Message-Id: <39D3BE3D.1ECBD07B@excite.no.spam.no.com>
System usage
Enchanted wrote:
>
> At the very end of my perl script, I'm getting this generated to
> STDERR (runs on FreeBSD)
>
> 21.098u 0.195s 0:48.40 43.9% 10+7145k 46+149io 0pf+0w
>
> One wild guess I have is that I may have some illegal division
> somewhere or something but if you look at it, it looks like it means
> something.
>
> Anyone have an idea what, or advice on how to investigate further?
> (and why it appears)
>
> Enchanted
------------------------------
Date: Thu, 28 Sep 2000 21:50:20 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: What does this do?!
Message-Id: <slrn8t7fg4.5q2.tjla@thislove.dyndns.org>
I was shocked! How could Tim Conrow <tim@ipac.caltech.edu>
say such a terrible thing:
>Just a note about credit where it's due: Neal Stephenson didn't invent this very
>interesting cipher, he just wrote about it. It was developed Bruce Schneier. Do
>a goolgle search on "cryptonomicon solitaire". E.g.
>
>http://www.hedonism.demon.co.uk/paul/solitaire/
Oh whoops, you are right. It has in the back of the book a note by bruce
saying how he invented it and all but my mind read it as Neal saying
that for some reason.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
You might have mail.
------------------------------
Date: Thu, 28 Sep 2000 20:45:57 +0100
From: "Kelly" <iznunyabidnes@home.here>
Subject: wrong value passed to text box
Message-Id: <A7NA5.1460$993.26651@news6-win.server.ntlworld.com>
Hello,
$country = "United States"
Country <input type="text" length="30" name="country" value=$country><br>
The above only enters a value of "United" (without quotes) in the text box.
Any ideas?
Thanks
Kelly
------------------------------
Date: Thu, 28 Sep 2000 15:53:59 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: wrong value passed to text box
Message-Id: <Pine.GSO.4.21.0009281553250.5957-100000@crusoe.crusoe.net>
[posted & mailed]
On Sep 28, Kelly said:
>$country = "United States"
>Country <input type="text" length="30" name="country" value=$country><br>
This is an HTML question. Is there any reason you DIDN'T put quotes
around the $country variable in the string here?!
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Thu, 28 Sep 2000 12:51:38 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: wrong value passed to text box
Message-Id: <39D3A14A.C1C8C461@vpservices.com>
Kelly wrote:
>
> $country = "United States"
That puts the letters the characters U-n-i-t-e-d- -S-t-a-t-e-s into the
variable $country.
If you meant to also put the double quote characters into that variable,
you should use something like the q() or qq() operators:
$country = q( "United States" );
> Country <input type="text" length="30" name="country" value=$country><br>
>
> The above only enters a value of "United" (without quotes) in the text box.
Or, it probably makes more sense to leave $country the way you had it
and put the quotes in the text string so it is easy to check if you have
them:
print qq(
Country <input
type = "text"
length = "30"
name = "country"
value = "$country"
><br>
);
--
Jeff
------------------------------
Date: Thu, 28 Sep 2000 22:44:21 +0100
From: "Kelly" <iznunyabidnes@home.here>
Subject: Re: wrong value passed to text box
Message-Id: <BSOA5.1847$993.34147@news6-win.server.ntlworld.com>
Thanks fellas
That sorted it.
I wrongly assumed that if I put quotes around $country that the textbox
would have displayed $country.
Kelly
Jeff Pinyan <jeffp@crusoe.net> wrote in message
news:Pine.GSO.4.21.0009281553250.5957-100000@crusoe.crusoe.net...
> [posted & mailed]
>
> On Sep 28, Kelly said:
>
> >$country = "United States"
> >Country <input type="text" length="30" name="country" value=$country><br>
>
> This is an HTML question. Is there any reason you DIDN'T put quotes
> around the $country variable in the string here?!
>
> --
> Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
> PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
> The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
> CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
>
>
>
------------------------------
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 4463
**************************************