[12239] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5839 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 31 04:07:13 1999

Date: Mon, 31 May 99 01:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 31 May 1999     Volume: 8 Number: 5839

Today's topics:
        Anyone know what is this script line meaning ?? (Austin Ming)
    Re: Anyone know what is this script line meaning ?? (Sam Holden)
    Re: Anyone know what is this script line meaning ?? (Sami Rosenblad)
    Re: Bandwidth [Was: Re: man pages and FAQs: why posted? (John Stanley)
    Re: Compiling perl under linux 2.2.9 (Paul Kimoto)
        current date slegarre@ireste.fr
    Re: current date <hove@ido.phys.ntnu.no>
    Re: FAQ 7.19: Why doesn't "my($foo) = E<lt>FILEE<gt>;"  (John Stanley)
        How to make a Beep(sound) via Perl ? <gump_xu@sc.mcel.mot.com>
    Re: HTML Tag Parsing Across Line Breaks (Sean McAfee)
    Re: package OO::Closures (was Re: In favor of extending <rick.delaney@home.com>
    Re: Perl Newbee (Ronald J Kimball)
    Re: perldoc -f alarm <michiel.verhoef@wkap.nl>
    Re: perldoc -f alarm (Sam Holden)
    Re: REMOTE_USER - How come I can't see it? <webmaster@chatbase.com>
    Re: req: directional help <office@asc.nl>
        Sort process (Twarren10)
        Sybase Perl <zarmo@altavista.net>
        Too many arguments... (Apache/mod_perl) <tomas.p@ericsson.com>
    Re: unexponentialize field from text file sroque@my-deja.com
        Use binmode for binary files (Was: Re: PB writing an up (Larry Rosler)
    Re: Use binmode for binary files (Was: Re: PB writing a (Alan Curry)
        where can i get a free Perl compiler on line? <edruba@cruzio.com>
    Re: Y2K infected Perl code (Benjamin Franz)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 31 May 1999 06:44:58 GMT
From: austin95002887@yahoo.com (Austin Ming)
Subject: Anyone know what is this script line meaning ??
Message-Id: <7itb5a$3mn$2@justice.csc.cuhk.edu.hk>

:
:
$basedir = "/cgi-bin/";
chdir($basedir) || die "could not cd to $basedir $!";

opendir(DIR,'.') || die "... $!";
@files = grep { $_ !~ m/^\./} readdir(DIR);
closedir(DIR);
:
:

--> @files = grep { $_ !~ m/^\./} readdir(DIR);

Anyone know what is this script line meaning ??



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://members.tripod.com/heshe/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




------------------------------

Date: 31 May 1999 06:50:49 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <slrn7l4ca9.ov6.sholden@pgrad.cs.usyd.edu.au>

On 31 May 1999 06:44:58 GMT, Austin Ming <austin95002887@yahoo.com> wrote:
>
>--> @files = grep { $_ !~ m/^\./} readdir(DIR);
>
>Anyone know what is this script line meaning ??

Yes.

Why don't you look up the documentation on readdir and grep and
then you can know too...

-- 
Sam

Remember that the P in Perl stands for Practical.  The P in Python
doesn't seem to stand for anything.
	--Randal Schwartz in <8cemsabtef.fsf@gadget.cscaper.com>


------------------------------

Date: Mon, 31 May 1999 10:03:03 +0300
From: blade@leela.janton.fi (Sami Rosenblad)
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <blade-3105991003030001@durandal.janton.fi>

> --> @files = grep { $_ !~ m/^\./} readdir(DIR);
> 
> Anyone know what is this script line meaning ??

It reads the contents of the opened directory handle DIR,
and discards any filenames that begin with a period.

-- 
Sami Rosenblad -- blade@leela.janton.fi -- running linux since 1999


------------------------------

Date: 31 May 1999 05:08:29 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Bandwidth [Was: Re: man pages and FAQs: why posted?
Message-Id: <7it5gd$r5h$1@news.NERO.NET>

In article <19990530.002008.1b5.rnr.w164w@locutus.ofB.ORG>,
Russell Schulz  <Russell_Schulz@locutus.ofB.ORG> wrote:
>stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>
>> In article <7hqgh1$bkh$1@srv38s4u.cas.org>,  <lvirden@cas.org> wrote:
>>> in this group... So if the bandwidth is going to be used anyways, it
>>> might as well be used on something like the FAQs.
>>
>> Invalid assumption.
>
>Unfortunately, you cut the part that made it a plausibly valid assumption.
>
>You know, the part about `newbies asking the FAQs'.  Yeah, that part.

Too bad "that part" doesn't make the assumption true. The volume of
questions hasn't dropped, the volume has gone up from repetative posting
of the FAQ and now the man pages.

But you are wrong anyway. "That part" that was being used to support the
assumption was the posting of binaries in alt.*. Like I said, nobody
checks the volume in this group to see if they have space to post
there.



------------------------------

Date: 31 May 1999 01:48:14 -0500
From: kimoto@lightlink.com (Paul Kimoto)
Subject: Re: Compiling perl under linux 2.2.9
Message-Id: <slrn7l48kt.5nh.kimoto@autolycus.antigonus.net>

In article <374dad8d.178658547@news.iu.net>, jlargent2@juno.com wrote:
> When I run the Configure script it finds my nsl and crypt libs( says
> they are cached) but then when it get to where it compiles try.c in
> the CC dir. it fails with ld unable to load -lnsl and if I change the
> linking order putting -lnsl last it fails on -lcrypt.

Well, either you have 'em or you don't.  The standard places on a 
libc6 (== glibc2) system are /lib/libnsl.so.1 and /lib/libcrypt.so.1.
If the cache is wrong, delete it (probably config.sh) and start 
afresh.  See the file called "INSTALL".

-- 
Paul Kimoto		<kimoto@lightlink.com>


------------------------------

Date: Mon, 31 May 1999 05:30:21 GMT
From: slegarre@ireste.fr
Subject: current date
Message-Id: <7it6pe$smt$1@nnrp1.deja.com>

Hello,


I need the date of the day, is there a function provided it?

Tanks

Steven


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 31 May 1999 09:42:48 +0200
From: Joakim Hove <hove@ido.phys.ntnu.no>
Subject: Re: current date
Message-Id: <k0n1zfxfzwn.fsf@ido.phys.ntnu.no>

slegarre@ireste.fr writes:

> Hello,
> 
> 
> I need the date of the day, is there a function provided it?

perldoc -f time
perldoc -f localtime

Or, if you are satisfied with a quick and dirty solution

$now = `date`;

This last solution works fine on Unix platforms, but I don't know
about other platforms. On a Unix box "man date" will tell how you can
format the output from "date".

HTH Joakim

-- 
=== Joakim Hove    www.phys.ntnu.no/~hove/     ======================
# Institutt for fysikk  (735) 93637 / 352 GF  |  Skoyensgate 10D    #
# N - 7034 Trondheim    hove@phys.ntnu.no     |  N - 7030 Trondheim #
=====================================================================


------------------------------

Date: 31 May 1999 05:14:35 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: FAQ 7.19: Why doesn't "my($foo) = E<lt>FILEE<gt>;" work right?
Message-Id: <7it5rr$r60$1@news.NERO.NET>

In article <3751f809@cs.colorado.edu>,
Tom Christiansen  <perlfaq-suggestions@perl.com> wrote:
Subject: Re: FAQ 7.19: Why doesn't "my($foo) = E<lt>FILEE<gt>;" work right?  

Syntax error at cfv.pl line 3, near "<lt"
Execution of cfv.pl aborted due to compilation errors.

Please us syntactically correct subjects. The Subject is the only place
to get both the question number and the question. If you quote Perl code
in the subject, why not make it valid perl code?

Before someone says "it is correct, it's POD", let's point out that it
is not POD. Passing that article through pod2text results in the
following output:



That's right. Nothing. 

Please. It is such a small thing to ask. 



------------------------------

Date: Mon, 31 May 1999 14:57:29 +0800
From: "Gump Xu" <gump_xu@sc.mcel.mot.com>
Subject: How to make a Beep(sound) via Perl ?
Message-Id: <7itbp5$37c$1@schbbs.mot.com>

Hi,
    I want my Perl program to make a Beep (warn sound)
when it ends. But I cannot find a function in Perl to do that.
Anyone can help me?

thanks,
--
Gump





------------------------------

Date: Mon, 31 May 1999 05:01:20 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: HTML Tag Parsing Across Line Breaks
Message-Id: <AIo43.972$ls.31004@news.itd.umich.edu>

In article <Pine.GSO.4.02A.9905301822360.8091-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@redcat.com> wrote:
>On Sun, 30 May 1999 themuppet@my-deja.com wrote:
>> Subject: HTML Tag Parsing Across Line Breaks

>If you want to parse HTML, you want to use a well-written module. You
>can't do it with simple regular expressions. See HTML::Parser on CPAN.
>Cheers!

I've been meaning to share a simple little program I wrote with the aid of
HTML::Parser, for the benefit of the uninitiated.  This seems like a good
opportunity to post it.

The problem to be solved was that I wanted to regularly browse EBay
(http://www.ebay.com) to find some rare items, but I didn't remember to do
it on my own often enough to have a good chance of finding them.  The
solution was to write a program that would check the site regularly for me
and mail me the results.  Simply mailing the results page in all of its
HTML glory would quickly become tiresome, so I needed a parser that would
extract only the relevant portions of the page.

Thus, the program "searchebay", below.  Each command-line argument is sent
to EBay as a query, and the results--item description and auction ending
time--are printed.  The program can easily be run out of cron; in my case:

0 8 * * 1,4 /home/mcafee/bin/searchebay alphaville '"marian gold"'

======================================================================
#!/usr/local/bin/perl

use LWP::Simple;
use URI::Escape;

$search = 'http://search.ebay.com/cgi-bin/texis/ebay/results.html?' .
    'dest=&cobrandpartner=x&maxRecordsPerPage=100&tc=&textonly=n&'  .
    'query=%s&SortProperty=MetaEndSort&whichIndex=current';

foreach $item (@ARGV) {
    $text = get(sprintf($search, uri_escape($item)));
    print "Results of EBay search for $item:\n\n";
    $parser = EBay->new;
    while ($text =~ /(.{300})/gs) {
        $parser->parse($1);
    }
    $parser->eof;
    print "\n\n";
}

BEGIN {
    package EBay;
    require HTML::Parser;
    @ISA = 'HTML::Parser';
    sub start {
        if ($_[1] eq "a") {
            $flag = $_[2]{href} =~ /ViewItem/;
        } elsif ($_[1] eq "td") {
            $col++;
        }
    }
    sub end {
        if ($_[1] eq "a") {
            $flag = 0;
        } elsif ($_[1] eq "tr") {
            $col = 0;
        }
    }
    sub text  {
        my $text = $_[1];
        if ($flag) {
            printf "%-60s ", $text;
        } elsif ($col == 5 && $text =~ /\S/ && $text !~ /^\s*Ends\s*$/) {
            $text =~ s/^\s+//; $text =~ s/\s+$//; $text =~ s/\s+/ /g;
            print "$text\n";
        }
    }
}
======================================================================

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu




------------------------------

Date: Mon, 31 May 1999 04:11:20 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: package OO::Closures (was Re: In favor of extending "my" to apply to  subroutines as well as variables)
Message-Id: <37520B99.AAF4458C@home.com>

[posted & mailed]

Abigail wrote:
> 
> Rick Delaney (rick.delaney@home.com) wrote on MMXCVIII September 
> // >
> // >         if ($method =~ /^([^:]+|:[^:])*::(.*)/s) {
> //                                   ^^^^^
> // >             $class  = $1;
> // >             $method = $2;
> // >         }
> // What kind of method name is this for?
> 
> It allows for class names with a ':' in them.

You mean like 'colon:separated:class::method'?  This gives

    $class  eq 'lass'
    $method eq 'method'

Maybe it needs some extra brackets

    if ($method =~ /^((?:[^:]+|:[^:])*)::(.*)/s) {

or something simpler might suffice

    if ($method =~ /^(.*?)::(.*)/s) {

I like that I can have 'method names
like 
this' if I want, though.

-- 
Rick Delaney
rick.delaney@home.com


------------------------------

Date: Mon, 31 May 1999 00:22:19 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl Newbee
Message-Id: <1dsn7nv.19q3ko1czp7l6N@p57.block2.tc4.state.ma.tiac.com>

Mike Likvan <mlikvan@home.com> wrote:

> Can anyone help me sort out these questions?

Not without seeing the code.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: Mon, 31 May 1999 09:44:02 +0200
From: Michiel Verhoef <michiel.verhoef@wkap.nl>
Subject: Re: perldoc -f alarm
Message-Id: <37523DC1.EF13397@wkap.nl>

I know from several commercial programms tthat kill -9 $pid is an accepted
way to end
programs.  In fact, several systems I know of leave a small pid file in a
directory that is
read and used by stop scripts to kill the server...

Michiel


Howard Jow wrote:

<snips>

> 1. ps -A (all unix boxes are different, I'm used to aux, anyways) and
> grep out (filter out, parse out, etc) bomb.pl
>
> 2. Use perl reg exps to find the PID
> 3. Use a system("kill -i $pid"); to take care of it.
>
> This is probably not the best way to do it...is there a more elegant
> solution?  Let me know...thanks!
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---



------------------------------

Date: 31 May 1999 07:59:55 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: perldoc -f alarm
Message-Id: <slrn7l4gbr.6g3.sholden@pgrad.cs.usyd.edu.au>

On 31 May 1999 09:44:02 +0200, Michiel Verhoef <michiel.verhoef@wkap.nl> wrote:
>I know from several commercial programms tthat kill -9 $pid is an accepted
>way to end
>programs.  In fact, several systems I know of leave a small pid file in a
>directory that is
>read and used by stop scripts to kill the server...

You have got to be joking... -9 is a bit excessive shall we say...

To quote Randal Schwartz :

                  No no no.  Don't use kill -9.
                   
                  It doesn't give the process a chance to cleanly:
                   
                  1) shut down socket connections
                   
                  2) clean up temp files
                   
                  3) inform its children that it is going away
                   
                  4) reset its terminal characteristics
                   
                  and so on and so on and so on.
                   
                  Generally, send 15, and wait a second or two, and if that
                  doesn't work, send 2, and if that doesn't work, send 1. 
                  If that doesn't, REMOVE THE BINARY because the program is
                  badly behaved!
                   
                  Don't use kill -9.  Don't bring out the combine harvester
                  just to tidy up the flower pot.
                   

-- 
Sam

The very fact that it's possible to write messy programs in Perl is also
what makes it possible to write programs that are cleaner in Perl than
they could ever be in a language that attempts to enforce cleanliness.
	--Larry Wall


------------------------------

Date: Mon, 31 May 1999 00:01:27 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: REMOTE_USER - How come I can't see it?
Message-Id: <375233C7.8BBAF877@chatbase.com>

Charles Pelkey wrote:
> 
> Remote User is only set if the user authenticates with the server...

<SNIP>

Yes, and I think Tom and everyone else here knows that too. But thanks
for the enlightenment (possibly for someone's benefit?). It was already
off topic, and you lacked to even get technical about it, so otherwise
stating the obvious only makes this off-topic post longer and wasn't
very educational, even for the original poster. If they said what web
server, OS, etc. that they were running, I'd have pointed them to the
appropriate NG for their question, why didn't you?
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


------------------------------

Date: Mon, 31 May 1999 09:31:09 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: req: directional help
Message-Id: <7itdui$amj$1@zonnetje.NL.net>

really?? than i don't feel like this is a website , but more some old woman
that tells you what you can do and what you can't do ..

cul8r
buZz

David Cassell heeft geschreven in bericht
<374DB376.756A5E3@mail.cor.epa.gov>...
>Bastiaan S van den Berg wrote:
>>
>> yeah!!!!!!!
>>
>> it now works fine!!! but when you posted it , i was sure it was offline..
>>
>> tnx anyways!
>> buZz
>>
>> >I just checked, and it's up.  Maybe it's my karma.  :-)
>> >
>> >You did try this URL with no typos, right?
>> >
>> >http://www.perlmonth.com/articles//rtfm.html
>> >
>> >That's a double-slash after 'articles'.
>
>You're welcome.  Even if you have a tendency not to attribute
>quotes, as is standard in Usenet.
>
>Actually, this is a test designed to see if you are really
>serious about learning Perl.  The webpage parses out your
>HTTP_REFERER and stores information about you in a database,
>and then makes sure that you have tried at least two previous
>times before letting you in.  If you are that determined,
>then you have one of the requirements to become a decent
>programmer.  If you read the entire article without getting
>sidetracked by the nude pictures of Pamela Anderson, then
>you have a second requirement.
>
>HTH,
>David
>--
>David Cassell, OAO                     cassell@mail.cor.epa.gov
>Senior computing specialist
>mathematical statistician




------------------------------

Date: 31 May 1999 05:24:24 GMT
From: twarren10@aol.com (Twarren10)
Subject: Sort process
Message-Id: <19990531012424.20837.00007670@ng-cf1.aol.com>

I am a new Pearl programmer who is working on a search program, which
uses a pipe delimited databases (|). Everything is working great in
search, the problem I am having now is in sorting the results in order to list
the matches which have more of the search terms higher than the matches which
have less. I know how to sort alphabetically, but this has me stumped. Can
anyone give me an idea how to accomplish this? Your help would be appreciated.

for example, I want to list the matches which have three of the search terms in
the number 1 list slot, with two would be listed number two, etc. 



------------------------------

Date: Mon, 31 May 1999 12:32:49 +0800
From: "Mozart" <zarmo@altavista.net>
Subject: Sybase Perl
Message-Id: <7it34a$lgb$1@nobel2.pacific.net.sg>

Hi,

I am trying to compile the Sybase Perl package.
When I do make test I got a problem as follow :
ld:fatal:library -lgdbm not found.

I checked the PERL library link and it appears that PERL has been compiled
with this library. Unfortunatelly I don't find it on my Solaris 2.6 system.

Anybody experienced the same problem ? How should I handled it ?

Thanks for your help
laurent.simonet@socgen.com





------------------------------

Date: 31 May 1999 09:24:12 +0200
From: Tomas Pihl <tomas.p@ericsson.com>
Subject: Too many arguments... (Apache/mod_perl)
Message-Id: <rvkvhd9hfc3.fsf@ericsson.com>


I've got a mod_perl script and each time I change it and it's
recompiled I have to restart Apache because it goes berzerk.

In apache/logs/error_log I get:

httpd: [Mon May 31 08:55:56 1999] [error] Too many arguments for Apache::ROOT::roomDude::room_2epl::dofind at /local/web/apache/htdocs/roomDude/room.pl line 49, near "%FORM)"


48:  } elsif ($FORM{op} eq "Search") {
49:     dofind(%FORM);
50:  } elsif ($FORM{op} eq "finduser") {
51:    finduser();


sub dofind()
{
  my (%FORM) = @_;
  my $mail = $FORM{email};
 .
 .
 .
}

I just can't figure out what's wrong.

---
Tomas Pihl
[add ihl after .p to reply]


------------------------------

Date: Mon, 31 May 1999 04:11:54 GMT
From: sroque@my-deja.com
Subject: Re: unexponentialize field from text file
Message-Id: <7it26b$q1r$1@nnrp1.deja.com>


> 	Does it have to be through regexp?
>
> 	$float = sprintf "%f", $exponential;
>
> --
> -Zenin (zenin@archive.rhps.org)         Caffeine...for the mind.
>                                         Pizza......for the body.
>                                         Sushi......for the soul.
>                                              -- User Friendly
>

Sorry, I never thought of using sprintf. But that will be all that I
need. Thanks, Zenin. Thanks also to Larry and Ilya.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Sun, 30 May 1999 21:22:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Use binmode for binary files (Was: Re: PB writing an uploaded file in perl (size changes!))
Message-Id: <MPG.11bbae2f2057382a989b38@nntp.hpl.hp.com>

In article <7HtllOkHw-B@khms.westfalen.de> on 31 May 1999 01:09:00 
+0200, Kai Henningsen <kaih=7HtllOkHw-B@khms.westfalen.de> says...
> lr@hpl.hp.com (Larry Rosler)  wrote on 28.05.99 in <MPG.11b8a90199eb5ca7989b28@nntp.hpl.hp.com>:
 ...
> > My point is -- why bother to skip it?  The documentation and the books
> > and the teachers should say that This Is THE Way To Do It.  Where it is
> > not needed, it costs NOTHING (modulo the time to read and parse one Perl
> > statement during compilation).  Where it is needed, it is essential.
> 
> Because it may not be clear to you if, were you to port your program to a  
> binmode-challenged system (which you have no intention to do), the file  
> you're working with would need binmode, because that would depend on  
> system properties you don't know about?
> 
> Or, to put it another way, sometimes the programmer is in the exact same  
> situation the perl binary is in.

Sorry, no.  That is not possible.  The programmer *always* knows.

Whether a file is 'text' or 'binary' depends on the program that writes 
the file, not on system properties.  A 'text' file has an internal 
logical structure of records terminated by newlines (however represented 
in external storage by the particular implementation); a 'binary' file 
does not.  The programmer knows this.  All the time.  And should use 
'binmode' for binary files.  All the time.

On output, binmode() translates each newline to its external 
representation as a record terminator; on input, it translates the 
external representation of a record terminator to a newline.  Nothing 
more, nothing less.

This has nothing whatever to do with the nature of the rest of the bytes 
that make up a file, be they seven-bit ASCII or eight-bit whatever.  
That is one reason the current '-B'/'-T' tests are a crock.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Mon, 31 May 1999 05:50:56 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Use binmode for binary files (Was: Re: PB writing an uploaded file in perl (size changes!))
Message-Id: <4rp43.795$ez3.37306@typ31b.nn.bcandid.com>

In article <MPG.11bbae2f2057382a989b38@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <7HtllOkHw-B@khms.westfalen.de> on 31 May 1999 01:09:00 
>+0200, Kai Henningsen <kaih=7HtllOkHw-B@khms.westfalen.de> says...
>> Because it may not be clear to you if, were you to port your program to a  
>> binmode-challenged system (which you have no intention to do), the file  
>> you're working with would need binmode, because that would depend on  
>> system properties you don't know about?
>> 
>> Or, to put it another way, sometimes the programmer is in the exact same  
>> situation the perl binary is in.
>
>Sorry, no.  That is not possible.  The programmer *always* knows.

I really don't.

>Whether a file is 'text' or 'binary' depends on the program that writes 
>the file, not on system properties.  A 'text' file has an internal 
>logical structure of records terminated by newlines (however represented 
>in external storage by the particular implementation); a 'binary' file 
>does not.  The programmer knows this.  All the time.  And should use 
>'binmode' for binary files.  All the time.

What if my file format begins with printf("%d\n%d\n",$rows,$cols) and is then
followed by $rows*$cols bytes (which can be any value including possibly \n),
then another printf("%d\n%d\n",$rows,$cols), and another $rows*$cols bytes,
and so on until EOF... is that a binary file? I dunno, I could say that the
first part is text and the rest part isn't. But maybe it's all binary. But I
don't really care, because I don't use any OS-wannabe's that care about the
difference.

>
>On output, binmode() translates each newline to its external 
>representation as a record terminator; on input, it translates the 
>external representation of a record terminator to a newline.  Nothing 
>more, nothing less.

I don't think in terms of "records". A file is a sequence of bytes. If your
OS disagrees with that definition, you can be the one to handle the porting
issues. The rest of us don't want to cripple ourselves that way. It's a waste
of time even thinking about it.
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


------------------------------

Date: Mon, 31 May 1999 11:45:44 -0700
From: "Eddie" <edruba@cruzio.com>
Subject: where can i get a free Perl compiler on line?
Message-Id: <7itaqd$e7b@enews2.newsguy.com>

I use win98, i need to know if there  is a free perl compiler online for
win98.can you tell me  which web site, i can go to download it.
Thanks.

Eddie R




------------------------------

Date: Mon, 31 May 1999 04:00:14 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Y2K infected Perl code
Message-Id: <iPn43.241$T7.36659@typhoon-sf.snfc21.pbi.net>

In article <x7iu99gaqx.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
>>>>>> "K" == Kristina  <kristina@greatbasin.net> writes:
>
>  K> I could also mention that some of us who post scripts are not (as you can
>  K> see from my code) programmers, and thus could probably really benefit
>  K> from someone saying, "Hey, look, your stuff is broken. Look at the damn
>  K> man page for thus-and-so!" :)
>
>i don't mean to be down on you, but why would you (or anyone) post a
>script if you are not a programmer? what bewilders me is why there is so
>much free perl/cgi stuff out there in those archives and how little was
>written by someone who IS a professional programmer.

Not that bewildering, really. Most professional programmers have very
little _time_ available for writing and supporting free scripts.
I have lots of scripts I would like to write - and no time to
do so.

-- 
Benjamin Franz


------------------------------

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 5839
**************************************

home help back first fref pref prev next nref lref last post