[9469] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3063 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 5 09:07:35 1998

Date: Sun, 5 Jul 98 06:00:52 -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           Sun, 5 Jul 1998     Volume: 8 Number: 3063

Today's topics:
    Re: 2-byte code match problem lvirden@cas.org
    Re: 2-byte code match problem <flavell@mail.cern.ch>
        5.004_69 win32 Glob problem <m.morley@NOSPAM.worldnet.att.net>
    Re: A funny problem with "use integer" (Sitaram Chamarty)
    Re: Any idea about ..... (Sitaram Chamarty)
    Re: attachment to email (John Hocking)
    Re: better way of getting the last modified file? <eugene@verticalnet.com>
    Re: better way of getting the last modified file? (Jonathan Stowe)
        clearing screen/curses <vicchiu@leland.Stanford.EDU>
    Re: clearing screen/curses <rra@stanford.edu>
    Re: Editors for Perl? (Sitaram Chamarty)
        Extracting a string (easy question) <hamilton@melbpc.org.au>
    Re: Extracting a string (easy question) <rra@stanford.edu>
    Re: Extracting a string (easy question) (Bob Trieger)
    Re: first language - last language (Sitaram Chamarty)
    Re: first mess up (Ronald J Kimball)
        GNUS and cperl-mode conflict? (Jeremy D. Zawodny)
    Re: Length and stripping function (Ronald J Kimball)
    Re: passing javascript var in perl cgi <quednauf@nortel.co.uk>
    Re: perl and vi.... (Sitaram Chamarty)
    Re: print $ENV{'PATH_INFO'} problem (Mark-Jason Dominus)
    Re: print $ENV{'PATH_INFO'} problem (Jonathan Stowe)
    Re: PUZZLE: dutree (new) (Sitaram Chamarty)
        Reading in GIFs <nc-magnusst@netcologne.de>
    Re: replacing search variable in foreach <quednauf@nortel.co.uk>
        Setting locale failed <mark@mclellan.com>
    Re: The vagaries of read()ing (John Siracusa)
    Re: The vagaries of read()ing <rra@stanford.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 Jul 1998 10:55:30 GMT
From: lvirden@cas.org
Subject: Re: 2-byte code match problem
Message-Id: <6nnm32$t0g$1@srv38s4u.cas.org>


According to Abigail <abigail@fnx.com>:
:Yun Giljung (mingtian@hanmail.net) wrote on MDCCLXVIII September MCMXCIII
:in <URL: news:359de7d1.34507217@usenet.kornet21.net>:
:++ i hope Perl is not be like Java or Visual Basic or TCL that use Unicode
:++ for their internal system, that really does not help 2 bytes codes.

:There doesn't seem to be any indication Perl is going towards fixed
:width 16bit characters. But it will have UTF-8 support.


The sad part of this is that there are additional, wider, versions of unicode
that still won't be supported.

However, hopefully if the utf-8 support is done correctly, additional changes
to support the wider utf's can be made interally and the perl programmer
won't need to know about it.

Support for fixed width 2 byte codes and variable width ones would just
make the core of perl about twice as large I suspect, since one would be
left with 3 or more variations on all the critical string parsing routines.

-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Sun, 5 Jul 1998 13:47:30 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: 2-byte code match problem
Message-Id: <Pine.HPP.3.95a.980705133619.29449I-100000@hpplus21.cern.ch>

On 5 Jul 1998 lvirden@cas.org wrote:

> According to Abigail <abigail@fnx.com>:
> :Yun Giljung (mingtian@hanmail.net) wrote on MDCCLXVIII September MCMXCIII
> :in <URL: news:359de7d1.34507217@usenet.kornet21.net>:
> :++ i hope Perl is not be like Java or Visual Basic or TCL that use Unicode
> :++ for their internal system, that really does not help 2 bytes codes.
> 
> :There doesn't seem to be any indication Perl is going towards fixed
> :width 16bit characters. But it will have UTF-8 support.
> 
> The sad part of this is that there are additional, wider, versions of unicode
> that still won't be supported.

Wider than utf-8 encoding supports?  I didn't know that anyone was
proposing more than 4-byte-wide characters.

> Support for fixed width 2 byte codes and variable width ones would just
> make the core of perl about twice as large I suspect, since one would be
> left with 3 or more variations on all the critical string parsing routines.

utf-8 is an encoding, that maps via published algorithms to and from
4-byte representation (or 2-byte where applicable).  There are several
other encodings of unicode defined.  Mostly they are intended for
compact data transmission, rather than for efficient data processing. 

I'd take an analogy: you don't expect to be able to perform normal
data-processing operations on strings that are stored in
quoted-printable form, you'd expect to transform those into a canonical
8-bit storage encoding first, I think.  I rather assumed the same would
be done for unicode, no?



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

Date: Sun, 05 Jul 1998 01:01:49 -0400
From: Matthew Morley <m.morley@NOSPAM.worldnet.att.net>
Subject: 5.004_69 win32 Glob problem
Message-Id: <6nn1c0$26c@bgtnsc01.worldnet.att.net>

There is a new version of Perl I downloaded from
       http://www.ActiveState.com/ActivePerl/

This is the new long awaited merged GSAR and ActiveState version!
It seems to fail returning directory nodes using the following
segment:

  foreach my  $node (<*/*/*/*-*>)
#  foreach my $node (<*>)  # works for one "*" but not several subdirs

  {
    print "$node\n";  # debug
  }

This match fails completely on win98 but of course works on UNIX.
It used to work with the previous GSAR port.

Is there a more efficient way to return a list of subdirectories with
the
4-th level subdirectory matching in "*-*" (star dash star)?  without
using globing?
Any ideas?  Thanks.
--
 Matthew Morley        m.morley@worldnet.att.net




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

Date: 5 Jul 98 03:20:33 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: A funny problem with "use integer"
Message-Id: <slrn6pte4r.dl7.sitaram@ltusitaram.diac.com>

On 30 Jun 1998 21:50:45 -0400, Lloyd Zusman <ljz@asfast.com> wrote:

>(3)  cat file | program
>
>     Alternative: program <file

For the aesthetically pedantic using a program that's not a
"typical-filter-program", this works in most bourne-ish shells at
least:
        < file program

>(5)  cat file | typical-filter-program   (see below)
>
>     Alternative: typical-filter-program file


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

Date: 5 Jul 98 03:20:37 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Any idea about .....
Message-Id: <slrn6ptfte.e9n.sitaram@ltusitaram.diac.com>

On Sun, 28 Jun 1998 18:17:20 +1000, David Coldrick <davidc@selectst.com> wrote:
>Don't understand. What's the diff between crossposting and posting
>twice, and what do you mean by "setting a followup"?

When you cross-post to newsgroups, it is still considered one
post.  One benefit is that newsreaders that can do cross-post
management won't show the same message twice to people who
subscribe to more than one of the groups to which you x-post.

You set "follow-ups" to specify where you would like follow-up
comments to go - you are essentially saying "I believe this
question needs to be seen by people in both these ngs, but further
discussion on it is best in this particular one, not the
other(s)".

[ This does have the effect of excluding people from some of the
original groups who do not subscribe to the "one chosen" group
from taking part in subsequent discussion, but if your target ng's
was well-chosen, the people who matter are following both ng's
anyway.  Especially when the 2 ng's are so closely related like
clp.misc and clp.modules. ]

Hope that wasn't clear as mud :-)

>Tom Phoenix wrote:
>> 
>> On Sat, 27 Jun 1998, delta wrote:
>> 
>> > Newsgroups: comp.lang.perl.modules
>> 
>> Your question was also posted to comp.lang.perl.misc. Don't do that. If a
>> message is appropriate for more than one newsgroup, crosspost and set
>> followups. In this case, it doesn't look like your question has anything
>> to do with modules, so I've set followups.
><snip>


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

Date: Sun, 05 Jul 1998 03:45:00 GMT
From: joker@inlink.com (John Hocking)
Subject: Re: attachment to email
Message-Id: <359ef5f1.108325403@news.inlink.com>

On Sat, 04 Jul 1998 00:04:33 -0700, Gangadhar Vaddepalli
<vadepali@ix.netcom.com> wrote:

>Hi There,
>I'm wondering whether we can attach another file to email using Perl.
>I want to send an attchment which is also an HTML file along with the
>message.
>

There are serveral scripts that you could use as examples on the net.
I would try
http://www.cgi-resources.com/Programs_and_Scripts/Perl/Form_Processing/

or some scripts on CPAN

John Hocking
Sr. Programmer
StudioPointe Incorporated
http://www.studiopointe.com
mailto:johnh@studiopointe.com


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

Date: Sun, 05 Jul 1998 00:25:46 -0400
From: Eugene Sotirescu <eugene@verticalnet.com>
Subject: Re: better way of getting the last modified file?
Message-Id: <359F004A.43E874E8@verticalnet.com>

Thanks, I get the idea now, though the code you posted doesn't work for me:

########################################################
#!/usr/local/bin/perl
use diagnostics;

opendir(THEDIR,"/usr/ns-home/common/times/") || die "Outta here -$!\n";

while(defined($file = readdir(THEDIR)))
{
   next if $file =~ m%^.{1,2}$%;
      if ( ($moddate = -M $file) > $lastmod )
      {
          $lastmod = $moddate;
           $lastfile = $file ;
        }
 }
  close THEDIR;

 print $lastfile;
###############################################

generates:


Use of uninitialized value at ./last_mod.pl line 9 (#1)

    (W) An undefined value was used as if it were already defined.  It was
    interpreted as a "" or a 0, but maybe it was a mistake.  To suppress
this
    warning assign an initial value to your variables.

Use of uninitialized value at ./last_mod.pl line 18 (#1)



Jonathan Stowe wrote:

> On Sat, 04 Jul 1998 19:40:10 -0400, Eugene Sotirescu wrote :
>
> >Thanks.
> >I had checked the "-X stuff" before posting.
> >The closest is the -M operator, though it takes some doing to make it
> >behave like the -t option of ls.  I'm looking to keep things simple and
> >make them more efficient, but so far I couldn't find a clean Perl
> >solution that fulfills these requirements in this case. That's why
> >I posted.
> >
>
> This is a little hack I had kicking around that finds the oldest file:
>
> #!perl
>
> opendir(THEDIR,".") || die "Outta here -$!\n";
>
> while(defined($file = readdir(THEDIR)))
> {
>    next if $file =~ m%^.{1,2}$%;
>    if ( ($moddate = -M $file) > $lastmod )
>      {
>         $lastmod = $moddate;
>         $lastfile = $file ;
>      }
> }
> close THEDIR;
>
> print $lastfile;
>
> __END__
>
> Now I'm sure this *could* be better, more efficient etc
> but it is an example of how such a thing can be done.  How to get it
> to do the other way round is left as an exercise (it is half past two
> after all ).
>
> /J\z
> Jonathan Stowe
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>





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

Date: Sun, 05 Jul 1998 12:04:10 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: better way of getting the last modified file?
Message-Id: <359f5135.769059@news.btinternet.com>

On Sun, 05 Jul 1998 00:25:46 -0400, Eugene Sotirescu wrote :

>Thanks, I get the idea now, though the code you posted doesn't work for me:
>
>########################################################
>#!/usr/local/bin/perl
>use diagnostics;
>
>opendir(THEDIR,"/usr/ns-home/common/times/") || die "Outta here -$!\n";
>
>while(defined($file = readdir(THEDIR)))
>{
>   next if $file =~ m%^.{1,2}$%;
>      if ( ($moddate = -M $file) > $lastmod )
>      {
>          $lastmod = $moddate;
>           $lastfile = $file ;
>        }
> }
>  close THEDIR;
>
> print $lastfile;
>###############################################
>
>generates:
>
>
>Use of uninitialized value at ./last_mod.pl line 9 (#1)
>
>    (W) An undefined value was used as if it were already defined.  It was
>    interpreted as a "" or a 0, but maybe it was a mistake.  To suppress
>this
>    warning assign an initial value to your variables.
>
>Use of uninitialized value at ./last_mod.pl line 18 (#1)
>
Well yeah - I did say it was a quick hack :-0

If you put say "my $lastmod = 0;" somewhere before the loop starts
that'll shut -w of course if you "use strict" then it will need all of
the variables predeclared in someway.

There is also a typo as Larry so rightly (and unerringly he does so
;-}) points out in the pattern to get rid of the . and .. directories
- there should be a "\" before the . otherwise you will get rid of all
1 or two character named files (actually that would be alright for me
as I tend to always call junk files with 1 or two character names).

While I think of it you probably want to ignore directories as well,
and if you put a full path in opendir like that you will have to
prepend that to the filename you got from readdir as that only returns
the filename not the full path.

This is beginning to look bad - shall we start again :-?

That will be of course:

#!perl -w
use diagnostics;
use strict;
use vars qw($pathname $file $lastfile $moddate $lastmod);

my $pathname = "/htdoc/gellys";

my $lastmod  = 0;

opendir(THEDIR,$pathname) || die "Outta here -$!\n";

while(defined($file = readdir(THEDIR)))
{
   next if $file =~ m%^\.{1,2}$%;
   $file = $pathname . "/" . $file;
   next if ( -d $file );

   if ( ($moddate = -M $file) > $lastmod )
     {
        $lastmod = $moddate;
        $lastfile = $file ;
     }
}
close THEDIR;

print $lastfile;
__END__

Now that *does* work

/J\ 
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Sat, 04 Jul 1998 22:11:27 -0700
From: Victoria Yee-Mui Chiu <vicchiu@leland.Stanford.EDU>
Subject: clearing screen/curses
Message-Id: <359F0AFF.6F47@leland.Stanford.EDU>

Hi,

Does anyone know how to clear the screen  using perl? I tried
running system command `clear` and that didn't work. What I wanted
to do is write information out to the screen, wait couple of seconds,
clear the screen and rewrite to screen.

Thanks,

vicchiu@stanford.edu


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

Date: 04 Jul 1998 22:28:31 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: clearing screen/curses
Message-Id: <m3ogv4c1ds.fsf@windlord.Stanford.EDU>

Victoria Yee-Mui Chiu <vicchiu@leland.Stanford.EDU> writes:

> Does anyone know how to clear the screen using perl? I tried running
> system command `clear` and that didn't work. What I wanted to do is
> write information out to the screen, wait couple of seconds, clear the
> screen and rewrite to screen.

Running clear should work, but you don't want to run it in backticks
(since you're then capturing the output rather than letting it clear the
screen).  Try:

        system 'clear';

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 5 Jul 98 03:20:40 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Editors for Perl?
Message-Id: <slrn6pthps.eei.sitaram@ltusitaram.diac.com>

On Thu, 02 Jul 1998 13:30:00 +0200, CRETEL Dominique
<dominique.cretel@cfwb.be> wrote:

>I know that it's not the first time that someone talk about this!
>But, beeing a new user of the excellent Perl, I want to know if it exist
>a good editor where you can get help on a Perl syntax by pressing a set
>of key (i.e. Shift F1) on a key word in the text script?

VIM is an editor that is a "clone" of vi.  Like all vi-clones, it
extends the functionality *tremendously* - I am a big fan.

Enough hype - but VIM can do what you want.  It has a feature to
lookup the man page of the word currently under the cursor.
However, it also has the capability to change it's settings based
on file type and other things, and you can change the "keyword
program" from the default of "man" to, say, "perldoc -f" if you
like.

HTH


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

Date: Sun, 05 Jul 1998 14:02:57 +1000
From: David Hamilton <hamilton@melbpc.org.au>
Subject: Extracting a string (easy question)
Message-Id: <359EFAF1.9FD35A1A@melbpc.org.au>

Howdy,

Can someone please tell me how to extract the first set of characters in
a line before a space, because I have a file with a set of E-Mails
followed by a date and time and I just need a list of E-mails to put
into a mail program, i.e.:

test1@blah.com 1/1/98 1:11:11
test1@blah.com 2/1/98 1:11:12
hello@abc123.com 3/3/99 1:13:11

Thanks.



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

Date: 04 Jul 1998 21:26:58 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Extracting a string (easy question)
Message-Id: <m3ra00c48d.fsf@windlord.Stanford.EDU>

David Hamilton <hamilton@melbpc.org.au> writes:

> Can someone please tell me how to extract the first set of characters in
> a line before a space,

There are a number of ways, but I usually use:

        $word = (split (' ', $line, 2))[0];

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sun, 05 Jul 1998 04:49:13 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Extracting a string (easy question)
Message-Id: <6nn0o9$voh$1@ligarius.ultra.net>

[ posted and mailed ]

David Hamilton <hamilton@melbpc.org.au> wrote:
-> Can someone please tell me how to extract the first set of characters in
-> a line before a space, because I have a file with a set of E-Mails
-> followed by a date and time and I just need a list of E-mails to put
-> into a mail program, i.e.:
-> 
-> test1@blah.com 1/1/98 1:11:11
-> test1@blah.com 2/1/98 1:11:12
-> hello@abc123.com 3/3/99 1:13:11

$foo = (split / /,$bar)[0];

For more info on regex and split, check out:

perldoc -f split
perldoc perlre


Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: 5 Jul 98 03:20:29 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: first language - last language
Message-Id: <slrn6psoji.cj8.sitaram@ltusitaram.diac.com>

On Sat, 27 Jun 1998 11:10:36 GMT, Bart Lateur <bart.mediamind@tornado.be> wrote:
>birgitt@my-dejanews.com wrote:
>
>>  What is the *last* language all you experts would ever want to
>>  deal with ? Don't say there isn't one.

Well I'm not an expert, but taking "first" to "last" as
evolutionary, the "last" language I ever want to deal with is
Perl!

(Like the violinist who constantly played the same note over and
over, and claimed 'all those others are looking for the "place",
*I* have *found* it!')

:-)

>Cobol, ADA, C. Popular for some mysterious reason taht escapes me
>completely. I'd prefer Smalltalk, Lisp, FORTH, Modula, APL, ... any
>time, although I've not done any real work using these.
>
>And I just can't grasp Prolog.
>
>	Bart.


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

Date: Sat, 4 Jul 1998 23:55:07 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: first mess up
Message-Id: <1dbo1s9.s2vffzfxtxiN@bay1-134.quincy.ziplink.net>

[posted and mailed]

Howard Dierking <howard@vortexweb.com> wrote:

> I corrected the syntax stuff I think--at least I I don't think this sounds
> like a syntax error:
> 
> exec of /usr/local/etc/httpd/cgi-bin/validateid.pl failed, errno is 2
> [Sat Jul  4 13:14:47 1998] access to
> /usr/local/etc/httpd/cgi-bin/validateid.pl
> failed for 1cust103.tnt1.hou1.da.uu.net, reason: Premature end of script
> headers
> 
> (that's the error)
> 
> Is there a list somewhere of errors and what they mean exactly?

I assume that is an excerpt from your CGI error log?  The second error
implies that you're still not outputting the proper headers.  The first
error says that this is because the script is not being executed.

Are you able to run the script from the command line?  Does the account
which executes CGI scripts have the proper access to the cgi-bin
directory?

On my system, errno 2 is 'No such file or directory'.  You should look
for an errno.h file to find out if it's the same on your system.  I
found it at /usr/sys/h/errno.h here, but it may be somewhere else for
you.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 04 Jul 1998 23:55:01 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: GNUS and cperl-mode conflict?
Message-Id: <m3n2aprlyi.fsf@peach.z.org>

This is an odd one I've stumbled upon. I'm using

  Emacs 20.2 on RadHat Linux 4.2
  Ilya's cperl-mode 3.6
  GNUS 5.6.23.

If I open a Perl script (thus loading cperl-mode and enabling
it for a buffer) and then do a 'M-x gnus', GNUS starts up but errors
before it is able to display the contents of the *Group* buffer.

In my *Messages* buffer, I find the following:

  nnml: Reading incoming mail...done
  Reading active file via nnml...
  Reading active file via nnml...done
  Generating the cache active file...
  Generating the cache active file...done
  No new newsgroups
  Wrong type argument: buffer-or-string-p, t

The last line, of course, being the clincher.

Is this a known problem? How can I diagnose/fix it? My gut feeling is
that cperl-mode is somehow responsible, but that's just speculation on
my part.

Thanks for any assistance.

Jeremy
-- 
Jeremy D. Zawodny                   Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/      jzawodn@wcnet.org

LOAD "LINUX",8,1


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

Date: Sat, 4 Jul 1998 23:55:09 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Length and stripping function
Message-Id: <1dbo25e.1qj7hkb1e79f40N@bay1-134.quincy.ziplink.net>

[posted and mailed]

Terry <terry@aol.com> wrote:

> I run an online newsletter, and on the form the value of the only field is
> "put your email here" (due to space consideration)  anyway
> 
> I get people who don't remove that and put their email before it and submits
> me their email which a PERL scripts automatically stres into a text file.

Social engineering solution (preferred):
**Don't put that value in the field!**
You don't have to worry about stripping it if it's never there.

Try labeling the field, instead:
Enter email address here: [________________________]

> What I want to do is find a way to strip that line if it is there.

s/put your email here//;

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sun, 05 Jul 1998 12:13:08 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: passing javascript var in perl cgi
Message-Id: <359F5FC4.227B6570@nortel.co.uk>

Jonathan Stowe wrote:
 
> Did you know that they took Alphabetti Spaghetti off the market
> because you could get BSE from it?
> 
Now, this one I don't get at all :)
-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 5 Jul 98 03:20:44 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: perl and vi....
Message-Id: <slrn6ptjd3.eei.sitaram@ltusitaram.diac.com>

On 28 Jun 1998 20:22:54 GMT, brian moore <bem@news.cmc.net> wrote:

>With perl as a part of your every-day editor, what do you do with
>it?

I use it to compute the size of data items in COBOL (I work on
COBOL conversions).  It's not a simple command, but a full-blown
script that parses the surrounding COBOL text and computes the
length for me.  About the only difference between using the
embedded perl and a plain ! filter is the fact that it's faster -
which is really very important considering how often I use it.


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

Date: 5 Jul 1998 00:41:03 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: print $ENV{'PATH_INFO'} problem
Message-Id: <6nn04v$plt$1@monet.op.net>

In article <359eac52.33523089@news.btinternet.com>,
Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>you would still be better off if you used CGI.pm and its
>path_info() method.

Why?

(Really curious.)


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

Date: Sun, 05 Jul 1998 12:04:13 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: print $ENV{'PATH_INFO'} problem
Message-Id: <359f5e74.2516279@news.btinternet.com>

On 5 Jul 1998 00:41:03 -0400, Mark-Jason Dominus wrote :

>In article <359eac52.33523089@news.btinternet.com>,
>Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>>you would still be better off if you used CGI.pm and its
>>path_info() method.
>
>Why?
>
>(Really curious.)

What do you want - the sunday morning answer or the saturday night
answer ?

Well it wasnt really addressed to the path_info() bit per se as that
just does:

return $ENV{PATH_INFO};

Although I guess if some server was discovered to do something really
horrible with the PATH_INFO and the author of CGI.pm found out then
that is where it would be fixed - the module does go to some lengths
to hide the quirks of various platforms from the user.

What I was actually thing about was all of that form stuff - If one is
going to "require" a file anyway to do it then in my opinion you might
as well "use CGI" and use its methods to create the form and reap all
the side benefits that come with it.

I know that CGI is claimed to be rather bloated and slow but I
regularly use it on a server that is a 486sx25 and it never really
seems a problem for the kind of applications I do.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 5 Jul 98 07:28:28 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: PUZZLE: dutree (new)
Message-Id: <slrn6pu1vu.fag.sitaram@ltusitaram.diac.com>

On 30 Jun 1998 17:42:46 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
>Why does this version run thrice as fast as the previous one?

Populating the data before going to &output is recursive - which
is linear in the new version (except for getdots, of course).

There's a lot of array slicing and dicing going on - epecially in
sizesort.

There're many regexes using \d+ - needlessly, since the new
version splits up the name and the size right at the start and
uses the result.  Especially inside sizesort...

Other than that - I give up.  After a couple of days, how about an
answer to your puzzle?  I'm sure there's a more specific answer
you were looking to get...


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

Date: Sun, 5 Jul 1998 12:37:11 +0200
From: "Stephan Magnus" <nc-magnusst@netcologne.de>
Subject: Reading in GIFs
Message-Id: <6nnol6$16j@news.netcologne.de>

Hi,

I just programmed some code to read in parts of a GIF and then all append
the parts to one file. I did it as follows:

open(ANFANG, "anfang.gif") || die;
binmode(ANFANG);
$anfang=<ANFANG>;
close (ANFANG);
open(RAUS, ">$home/images/jawohl.gif") || die;
binmode(RAUS);
print RAUS  $anfang;
close(RAUS);

open(GRUND, "bild1.gif") || die;
binmode(GRUND);
$daten_bild1=<GRUND>;
close (GRUND);
open(GRAUS, ">>$home/images/jawohl.gif") || die;
binmode(GRAUS);
print GRAUS  $daten_bild1;
close(GRAUS);
open(KRAGEN, "bild2.gif") || die;
binmode(KRAGEN);
$daten_bild2=<KRAGEN>;
close (KRAGEN);
open(GRAUS, ">>$home/images/jawohl.gif") || die;
binmode(GRAUS);
print GRAUS  $daten_bild2;
close(GRAUS);

This should read in three parts and should combine them in the file
jawohl.gif in a sequential manner. But that doesn4t work. When I looked at
the HEX- Code of the resulting GIF I see that the code doesn4t take the
whole GIF- Data when it reads the file. It just reads about a third of
bild1.gif and bild2.gif and combines this uncomplete information.
Any idea why this is the way it is?

Thanks

Script happens!
Stephan





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

Date: Sun, 05 Jul 1998 12:10:38 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: replacing search variable in foreach
Message-Id: <359F5F2E.B4B595A9@nortel.co.uk>

Jonathan Stowe wrote:
> 
>
> >- <root.noharvest.\@not_even\here.com> wrote:
> >
> >>
> <snip>
> >>                                                  I never use return
> >> values, and my programs work great.

Disturbing.

> 
> Anyhow.  David Beckham walks into the Sperm bank and says he wants to
> make a donation.  The nurse asks him whether he has donated before to
> which he answers positively.  "Ok I'll just look on the computer for
> your details" she says.  After a short while she looks up and says :
> "I'm sorry Mister Beckham but you'll have to wait until we can get
> Posh Spice here before you can make your donation". "Why's that?", he
> say's. "Well it says on your file you're a Useless wanker ..."
> 

HAHA! Yep, his undoing in the game was pretty pathetic. Every team I am
supporting
seems to drop out, and a red card is involved. Geez, football's not coming home.


-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Sun, 5 Jul 1998 02:51:22 -0400
From: "Mark McLellan" <mark@mclellan.com>
Subject: Setting locale failed
Message-Id: <359f1fc4.0@news.dca.net>

I just installed PERL 5.004_04 and I am getting the following warning after
running either "perl -v" or "filename.pl".
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = "en_US.ISO8859-1",
        LANG = "us"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Does anyone have a solution for this warning?
Thank you,
Mark McLellan
mark@mclellan.com

System configuration follows:
Linux 2.0.29
Caldera Open Linux 2.1
gcc version 2.7.2.1
This is perl, version 5.004_04 built for i586-linux
Upgraded from:
This is perl, version 5.003 with EMBED
        built under linux at Jan 28 1997 15:31:03
        + suidperl security patch
Libnet-1.05
MD5-1.7
libwww-perl-5.07
Data-Dumper-2.07
Also, I went to Infoseek's search engine and found a dozen or so people
having the same problem. I did not see any solutions except one that
recommended setting the environment variable LC_ALL to en_US.ISO8859-1. I
did this (see above) and it did not work. I got the same error listed above.




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

Date: 5 Jul 1998 03:42:09 GMT
From: macintsh@cs.bu.edu (John Siracusa)
Subject: Re: The vagaries of read()ing
Message-Id: <6nmsmh$n1q$1@news1.bu.edu>

Well, after a few emails from helpful people, I think I've got it
licked.  Popular opinion was that using read() on a non-blocking
socket is probably not a a good idea.  The solution I used works on
both Unix Perl and MacPerl.  It uses sysread() to do the reading,
checking for EINTR while doing reads.  If any other error occurs after
an attempted sysread(), $! is checked for one of the following:

1. EWOULDBLOCK, meaning nothing was waiting to be read.

2. ECONNRESET, ECONNABORTED, ENOTCONN, meaning the connection has
   been abruptly terminated.  This covers everything I've encountered
   during testing on a few Unix flavors and the latest release of
   MacPerl.

3. Anything else I treat as a fatal error.

I have a feeling I'm still missing a few errno values, but hopefully
nothing that doesn't deserve to be a fatal error.  Thanks to all those
that helped.

-----------------+----------------------------------------
  John Siracusa  | If you only have a hammer, you tend to
 macintsh@bu.edu | see every problem as a nail. -- Maslow


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

Date: 04 Jul 1998 22:30:53 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: The vagaries of read()ing
Message-Id: <m3lnq8c19u.fsf@windlord.Stanford.EDU>

John Siracusa <macintsh@cs.bu.edu> writes:

> Well, after a few emails from helpful people, I think I've got it
> licked.  Popular opinion was that using read() on a non-blocking socket
> is probably not a a good idea.  The solution I used works on both Unix
> Perl and MacPerl.  It uses sysread() to do the reading, checking for
> EINTR while doing reads.  If any other error occurs after an attempted
> sysread(), $! is checked for one of the following:

> 1. EWOULDBLOCK, meaning nothing was waiting to be read.

For what it's worth, I would recommend selecting on the socket before
reading even if nonblocking is set.  I've had the experience on a few
platforms of having sysread() *still* take a while to return if there's no
waiting data, but selecting first to see if there's anything waiting seems
to always work.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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