[16043] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3455 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 22 18:05:44 2000

Date: Thu, 22 Jun 2000 15:05:29 -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: <961711528-v9-i3455@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 22 Jun 2000     Volume: 9 Number: 3455

Today's topics:
    Re: Activeware Perl and Windows 2000 <rootbeer@redcat.com>
    Re: Any website on Perl programming? <peter.sundstrom@eds.com>
    Re: basic ipchains perl scripts <dwilgaREMOVE@mtholyoke.edu>
    Re: basic ipchains perl scripts <care227@attglobal.net>
    Re: BIG BUG in CGI.pm on Internet Explorer !! <flavell@mail.cern.ch>
    Re: BIG BUG in CGI.pm on Internet Explorer !! <godzilla@stomp.stomp.tokyo>
    Re: BIG BUG in CGI.pm on Internet Explorer !! <mike@crusaders.no>
    Re: BIG BUG in CGI.pm on Internet Explorer !! <flavell@mail.cern.ch>
    Re: CGI::Carp cluck abbreviating msgs? <rootbeer@redcat.com>
    Re: counting elements in anonymous arrays <billy@arnis-bsl.com>
    Re: counting elements in anonymous arrays (Tim)
    Re: counting elements in anonymous arrays sonicbphuct@my-deja.com
    Re: counting elements in anonymous arrays (Greg Bacon)
    Re: Creating a cause from information. malverian@my-deja.com
    Re: date ? <NOpcoa@SPAMesatclear.iePlease>
    Re: date ? <rootbeer@redcat.com>
    Re: defined() <mjcarman@home.com>
    Re: Directory spaces causing problems? <tina@streetmail.com>
    Re: Editing text file...how? (Greg Bacon)
        Error in POSIX.pm when using signal handlers <sludin@aeneid.com>
        Finding the demensions of an image. <shawnball@uswest.net>
    Re: Finding the demensions of an image. <mike@crusaders.no>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 22 Jun 2000 12:42:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Activeware Perl and Windows 2000
Message-Id: <Pine.GSO.4.10.10006221241240.4312-100000@user2.teleport.com>

On Thu, 22 Jun 2000, Kimochi3D wrote:

> on my win2k box, it prints out the environment variables, but there
> are no values in them!!

If things are truly as you say, it sounds as if you've found a serious bug
in Perl. Be sure to file a bug report via perlbug. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 23 Jun 2000 09:47:47 +1200
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Any website on Perl programming?
Message-Id: <8iu1m1$t02$1@hermes.nz.eds.com>


Ross Xu wrote in message ...
>Dear there,
>I have no book on Perl programming on hand. So I want to learn from some
web
>site on it (except that perl FAQ).
>Could you please tell me where it is?
>Thank you in advance.


Ever heard of www.perl.com or a search engine?




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

Date: Thu, 22 Jun 2000 20:01:11 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: basic ipchains perl scripts
Message-Id: <dwilgaREMOVE-9383E4.16011422062000@news.mtholyoke.edu>

In article <39524CA0.3776C4D5@attglobal.net>, Drew Simonis 
<care227@attglobal.net> wrote:

> You were not on topic in any case.  This group is for the discussion 
> of the Perl programming language.  It is not a source for free scripts.
> 
> Talking about a Perl script you want is not the same as talking about
> Perl.

I, for one, disagree. I can think of far more off-topic questions than this. 
This post was not flame-worthy, IMHO. Jonathan also seems to think so as well, 
and his response was helpful in pointing the poster along the right path 
(which basically told him where to look in order to get started writing a 
routine to do what he wants.)

One of the basic tenets of Perl is to try not to reinvent the wheel. How can 
you know whether you are reinventing it or not if you don't ask other 
inventors whether they have already done so?

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Thu, 22 Jun 2000 16:04:21 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: basic ipchains perl scripts
Message-Id: <39527145.D3B404C6@attglobal.net>

Dan Wilga wrote:
> 
> I, for one, disagree. I can think of far more off-topic questions than this.
> This post was not flame-worthy, IMHO. Jonathan also seems to think so as well,
> and his response was helpful in pointing the poster along the right path
> (which basically told him where to look in order to get started writing a
> routine to do what he wants.)
> 

If the OP had asked for a pointer to resources or assistance with 
writing, I wouldn't have said a word.  What he did say was:

wmcn > Hi I'm looking for basic ipchains perl scripts to link to my
wmcn > forms to remote configure ipchains debian box.

Thats not asking for help with, thats asking for.


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

Date: Thu, 22 Jun 2000 19:52:53 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: BIG BUG in CGI.pm on Internet Explorer !!
Message-Id: <Pine.GHP.4.21.0006221945010.12575-100000@hpplus03.cern.ch>

On Thu, 22 Jun 2000, Anonymouse wrote:

> > > Although having some bugs (like any other software), MSIE is much more
> > > up to standards than any other browser I can think of,
> >
> > This is clearly false.
> 
> You have to work both with Internet Explorer and Netscape 

I do.

> to realize how superior IE is over Netscape. 

This is a Perl programming group, not a browser advocacy forum.  A
specific issue was raised and I responded to it.  Let's not turn this
into a free for all.  If you have a technical disagreement with what
was posted, let's see you citing chapter and verse.  If you just want
to slag off browsers against each other, move the discussion somewhere
appropriate, please.

thanks



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

Date: Thu, 22 Jun 2000 11:42:26 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: BIG BUG in CGI.pm on Internet Explorer !!
Message-Id: <39525E12.308E64AA@stomp.stomp.tokyo>

Makau Divangamene wrote:

(snipped)

> noticed that NO ONE found a solution to my problem. 
> NO ONE has even experienced it (!)


I made some notes on both a solution and on having
noticed this bug with certain combinations of browsers
and systems. 

My suggestion was and is to simplify your script as
much as possible to reduce this bug with browser
system combinations which do not meet commonplace
industry standards as set by popular use of Mozilla
overlaying Win 98 SE. Be sure you understand these
industry standards are set by user end statistics,
not by the industry itself, an industry which cannot
even agree on which is a best booger picking method.

If you truly want a technical answer, write code which
detects selected browser / system combinations exhibiting
this bug with clobbering query strings and referrer.

Piece of cake, just write enough of your own read and
parse routines to handle each specific combination
of browsers and systems boogering things up. Each read
and parse is a sub-routine kicked over by your coding
to detect browser / system combinations.

Shouldn't have to write more than a dozen different
read and parse routines to handle these buggy annoying
browser / system combinations which represent less
than one percent of systems encountered on our net.

Personally, I don't bother with those people who don't
have enough sense to not run buggy systems clearly known
to be incompatible with our internet. My androids give
them the boot and provide a message to upgrade to meet
industry standards, then return.


Godzilla!


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

Date: Thu, 22 Jun 2000 21:20:00 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: BIG BUG in CGI.pm on Internet Explorer !!
Message-Id: <TFt45.1888$PQ4.36494@news1.online.no>


Makau Divangamene <makau@multimania.com> wrote in message
news:8iop4e$u9t$1@nnrp1.deja.com...
> That thing is driving me crazy !!!
>
> CGI.pm keeps omitting parameters of $ENV{QUERY_STRING} randomly on
> IE5 !! In the beginning when my code was rather simple, there was
> absolutely no problem. But I soon as my code grew up more and more,

What makes you think it's not the other way around?

A CGI-script - and definately modules called from a CGI-script, doesn't
care much about the browser that called it. In most cases CGI-scripts
will produce the same output given the same input. If any browsers for
some reason does not send the input you expect to the script, then this
is a problem with the browser, not the script (and certainly not with
CGI.pm)

Anyway - IE (at least 4 and 5, don't remember if 3 has the same feature)
will for some reason translate HTML-entities in URLs, and it doesn't
even require the required ending ; for the entity.

e.g. you call the URL

http://server/path/script?yadi=yada&gti=cool

now, IE will understand that you really meant to call the URL:

http://server/path/script?yadi=yada>i=cool

which could be slightly annoying.

--
Trond Michelsen





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

Date: Thu, 22 Jun 2000 22:38:23 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: BIG BUG in CGI.pm on Internet Explorer !!
Message-Id: <Pine.GHP.4.21.0006222224200.16226-100000@hpplus03.cern.ch>

On Thu, 22 Jun 2000, Trond Michelsen wrote:

> Anyway - IE (at least 4 and 5, don't remember if 3 has the same feature)
> will for some reason translate HTML-entities in URLs,

That "some reason" is the published interworking specification.

> and it doesn't
> even require the required ending ; for the entity.

And so is that.

> e.g. you call the URL

No, the URL is correct.  The fault is in failing to code it correctly
in the HREF= or SRC= attribute value.

> http://server/path/script?yadi=yada&gti=cool

But you wouldn't do that because it contravenes the published
interworking specification.  So there wouldn't be a problem.

> which could be slightly annoying.

So code according to the rules, and then there isn't a problem.

There's a slight CGI.pm issue here.  There's one example in the CGI.pm
documentation that only works when the newstyle-urls pragma is in
effect.  But in elderly versions of CGI.pm this is not the default.
I think the change was made around version 2.65.  But for anyone who
understood HTML, this would be obvious.  It's not clear to me what
business anyone has to be writing CGI scripts if they don't understand
HTML, so I didn't dispute L.Stein's answer that this detail didn't
seem worth documenting.  Well, OK, now it's documented in the archives
of this group.

Curiously, Lynx, which is usually exemplary in its support for the
published standards, in this case does what the author intended,
rather than provoking the error that the published specification calls
for.  I suppose they thought it was better to help the users cope with
broken web pages.  Unfortunately, as always on the WWW, this kind of
behaviour only encourages authors to write broken web pages.  Roll on
standards-conforming XML, and a pox on tag soup.  

hth.



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

Date: Thu, 22 Jun 2000 13:20:22 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: CGI::Carp cluck abbreviating msgs?
Message-Id: <Pine.GSO.4.10.10006221319200.4312-100000@user2.teleport.com>

On Thu, 22 Jun 2000, Hardy Merrill wrote:

> I'm using "cluck" because I want to get a stacktrace when an error
> occurs.  Some of the messages that I "cluck" are lengthy, and it seems
> like cluck is abbreviating them, so that my full helpful text is being
> truncated like "here's some useful text..." with the "..." at the end of
> the message, where there should be more text.

I can't see how that could be happening. Could you make a small,
self-contained example program which shows what you mean? Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 22 Jun 2000 18:13:22 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: counting elements in anonymous arrays
Message-Id: <8itkvh$f59$1@nnrp1.deja.com>

In article <8iteld$9pv$1@nnrp1.deja.com>,
  sonicbphuct@my-deja.com wrote:
> I saw some posts by Brad Baxter that looked like it was counting the
> elements in the array, but I couldn't understand what it was doing.
> Anyway, all I really want to do is get the number of elements in an
> anonymous array returned by the DBI fetchrow_arrayref() method. It
> returns a reference to an array that contains all the columns in a
> row. I do something like this:
>
> ...
> while ( $q_ref = $sth->fetchrow_arrayref ) {
>    # $q_ref is usually equal to something like "HASH(0x2002075c)"
>    # I've tried a number of combos that are in the realm of:
>    # ${#q_ref} # returns 0
>    # @{$q_ref} # doesn't work at all
>    # @{'q_ref}' # doesn't return anything at all but exits normally
>    # and a bunch of other things that I just get syntax errors on.
>
>    # Ideally, I want (even though I know that I could get a col. count
>    # from the $sth->{NUM_OF_COLUMNS} thingy) to find out how many
>    # elements are in the array. I guess I'm just curious about how
this
>    # would work.
>        while ( $count != ${#$q_ref} {
>            print $q_ref->[$count++];
>        }
> }
>

If you have array reference $aref
then you may get the number of elements as:

@$aref  # in scalar context

or

$#$aref + 1

Try:

#!/usr/bin/perl -w

use strict;

my $aref = [ 1,2,3,4,5 ];

my $aref_size = @$aref;

print $aref_size;

# that's all

Hope this helps.
Ilja.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 22 Jun 2000 18:28:34 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: counting elements in anonymous arrays
Message-Id: <8F5B8B2B6indigodimcom@166.93.207.145>

sonicbphuct@my-deja.com wrote in <8iteld$9pv$1@nnrp1.deja.com>:

>I saw some posts by Brad Baxter that looked like it was counting the
>elements in the array, but I couldn't understand what it was doing.

All you need to is dereference and evaluate in scalar context:

my $ref = [ qw( a b c d e f) ];
my $x = @$ref;

print "Size is $x\n";

-T


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

Date: Thu, 22 Jun 2000 18:43:04 GMT
From: sonicbphuct@my-deja.com
Subject: Re: counting elements in anonymous arrays
Message-Id: <8itmnj$gj1$1@nnrp1.deja.com>

Thank you very much. It works like a charm!

-Josh

In article <8itkvh$f59$1@nnrp1.deja.com>,
  Ilja Tabachnik <billy@arnis-bsl.com> wrote:
> In article <8iteld$9pv$1@nnrp1.deja.com>,
>   sonicbphuct@my-deja.com wrote:
> > I saw some posts by Brad Baxter that looked like it was counting the
> > elements in the array, but I couldn't understand what it was doing.
> > Anyway, all I really want to do is get the number of elements in an
> > anonymous array returned by the DBI fetchrow_arrayref() method. It
> > returns a reference to an array that contains all the columns in a
> > row. I do something like this:
> >
> > ...
> > while ( $q_ref = $sth->fetchrow_arrayref ) {
> >    # $q_ref is usually equal to something like "HASH(0x2002075c)"
> >    # I've tried a number of combos that are in the realm of:
> >    # ${#q_ref} # returns 0
> >    # @{$q_ref} # doesn't work at all
> >    # @{'q_ref}' # doesn't return anything at all but exits normally
> >    # and a bunch of other things that I just get syntax errors on.
> >
> >    # Ideally, I want (even though I know that I could get a col.
count
> >    # from the $sth->{NUM_OF_COLUMNS} thingy) to find out how many
> >    # elements are in the array. I guess I'm just curious about how
> this
> >    # would work.
> >        while ( $count != ${#$q_ref} {
> >            print $q_ref->[$count++];
> >        }
> > }
> >
>
> If you have array reference $aref
> then you may get the number of elements as:
>
> @$aref  # in scalar context
>
> or
>
> $#$aref + 1
>
> Try:
>
> #!/usr/bin/perl -w
>
> use strict;
>
> my $aref = [ 1,2,3,4,5 ];
>
> my $aref_size = @$aref;
>
> print $aref_size;
>
> # that's all
>
> Hope this helps.
> Ilja.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 22 Jun 2000 20:53:44 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: counting elements in anonymous arrays
Message-Id: <sl4v6oqfe7f81@corp.supernews.com>

In article <8iteld$9pv$1@nnrp1.deja.com>,
     <sonicbphuct@my-deja.com> wrote:

: I saw some posts by Brad Baxter that looked like it was counting the
: elements in the array, but I couldn't understand what it was doing.
: Anyway, all I really want to do is get the number of elements in an
: anonymous array returned by the DBI fetchrow_arrayref() method.

The way to find the length of a Perl array is to examine it in scalar
context, e.g.,

    @array  = qw/ apples oranges bananas /;
    $length = @array;  # $length is 3

If you have an array reference, you have to first dereference, e.g.,

    $a = [ qw/ apples oranges bananas / ];
    $length = @$a;

See the perlref and perlreftut manpages.

Greg
-- 
In Christianity neither morality nor religion come into contact with reality
at any point.
    -- Nietzsche


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

Date: Thu, 22 Jun 2000 18:30:32 GMT
From: malverian@my-deja.com
Subject: Re: Creating a cause from information.
Message-Id: <8itm08$g1r$1@nnrp1.deja.com>


> You *are* aware that you're throwing away a line from SOCK each time
> through the loop?  It might be okay, but you may want to work with
> $_ instead of reading a new line into $data.

Are you positive I am losing a line? When i tell it to print STDOUT
$data
It prints it exactly how it should...


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 22 Jun 2000 21:48:40 +0100
From: "Flashlad" <NOpcoa@SPAMesatclear.iePlease>
Subject: Re: date ?
Message-Id: <8itu4u$ei2$1@fraggle.esatclear.ie>

This is the code i'm working with

#!/usr/bin/perl

$pagepath = $ENV{'DOCUMENT_URI'};

sub date {
   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
   @months = ("1","2","3","4","5","6","7","8","9","10","11","12");
   $date = "$mday";
}
$date;
$first = "/buckland/p/a/paddyboy/www/cgi-bin/";
$second = "$date";
$third = ".txt";
$first .=$second.=$third;
$counter_file = $first;
print "Content-type: text/html\n\n";

open(FILE, ">>$counter_file");
close(FILE);

open(FILE, "$counter_file");
@indata = <FILE>;
close(FILE);

$onoff = 0;
open(FILE, ">$counter_file");
foreach $temp (@indata)
{
 chop($temp);
 ($uri, $count) = split(/\=/, $temp);
 if ($uri eq $pagepath) {
  $count++;
  $onoff = 1;
  print FILE "Text=$count times\n";
  print "$count"; }
 else { print FILE "Text=$count times\n"; }
}
if ($onoff eq 0) {
 print FILE "text = 1\n";
 print "1"; }

close(FILE);



Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.10006211420280.4312-100000@user2.teleport.com...
> On Wed, 21 Jun 2000, Flashlad wrote:
>
> > How do you get todays day number (as in 21) and concat it into a varible
> > with other bits of a url
> >
> > e.g.  /blah/blah/(todays date here).html
> >
> > i can get three vars together like this $first .=$second.=$third
> > but it doesn't work when I use $mday
>
> Sounds as if you've gotten $mday from a function whose documentation you
> read. :-)  But your code for concatenation could use some help: '.=' is
> the append operator, '.' is the one for concatenation. See perlop.
>
> If that doesn't solve your problem, you may need to post a small,
> stand-alone example of the code you're trying.
>
> Good luck with it!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Thu, 22 Jun 2000 14:23:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: date ?
Message-Id: <Pine.GSO.4.10.10006221410350.4312-100000@user2.teleport.com>

On Thu, 22 Jun 2000, Flashlad wrote:

> #!/usr/bin/perl

Probably should use warnings and 'use strict' to tell perl to inform you
of your mistakes, wherever it can.

> sub date {
>    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

You should probably use lexical ("my") variables rather than globals.

>    @months = ("1","2","3","4","5","6","7","8","9","10","11","12");

That's the hard way to do it, but okay....

>    $date = "$mday";
> }

Those quote marks are merely misleading. And it's much better to use a
proper return value rather than to set globals, in general.

> $date;

I'm not sure what you think this line is doing. It's probably not doing
whatever that is.

> $first .=$second.=$third;

Please allow me to quote another part of your message, where you quoted my
response to this line of code:

    > > > i can get three vars together like this $first .=$second.=$third
    > > > but it doesn't work when I use $mday
    > >
    > > Sounds as if you've gotten $mday from a function whose
    > > documentation you read. :-)  But your code for concatenation 
    > > could use some help: '.=' is the append operator, '.' is the 
    > > one for concatenation. See perlop.

My advice there still stands.

> open(FILE, ">>$counter_file");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> open(FILE, "$counter_file");
> @indata = <FILE>;
> close(FILE);
> 
> $onoff = 0;
> open(FILE, ">$counter_file");

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. 

   http://www.stonehenge.com/merlyn/WebTechniques/

>  chop($temp);

Do you remember when you first heard of Yahoo? Nearly all uses of chop()
were replaced by chomp() back in the days before there was any such thing
as www.yahoo.com. Long time ago. If you've been learning Perl out of old
books, you should probably buy some new ones.

>  ($uri, $count) = split(/\=/, $temp);

That backslash is merely misleading.

There may well be other problems with your code. But these will keep you
busy for a while!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 22 Jun 2000 13:04:10 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: defined()
Message-Id: <3952551A.6D03143A@home.com>

Brendon Caligari wrote:
> 
> I'm trying to introduce myself to perl and finding it tough to get 
> used to the 'culture shock'.

Then you should introduce yourself to perldoc, it's a nifty little
resource that came with your installation of Perl. Type these at your
command line:

perldoc perldoc
perldoc perltoc
perldoc perl

That should get you off and running.

> (I'm also new to usenet <cough> but don't spread the word around).

Go check in at news.announce.newusers -- it just might give you some
pointers to make your experiences here more pleasant, and less likely to
get flamed.
 
> what's the purpose of the defined() function?

'perldoc -f defined' begins "Returns a Boolean value telling whether
EXPR has a value other than than undefined value..." Check it out.

Basically, Perl distinguishes between truth, definedness, and (for hash
keys) existance. It's subtle sometimes, but useful and important.

>    while ($strIn = <STDIN>) {}

If $strIn is ever equal to 0 or '' the loop condition will evaluate to
false and you'll fall out. 

> while (defined($strIn = <STDIN>)) {}

With this, you won't, because 0 or '' are defined values. You'll loop
until you run out of input. One practical note: This is a boundary
condition. Input (from the keyboard or a file) normally has a newline
char at the end which would evaluate to boolean true. So the bug in the
first approach will really only occur if a file has an incomplete last
line.

-mjc


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

Date: 22 Jun 2000 21:48:32 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Directory spaces causing problems?
Message-Id: <8iu1jg$5hjp4$1@fu-berlin.de>

hi,

Tad McClellan <tadmc@metronet.com> wrote:
> On 22 Jun 2000 03:29:55 GMT, Tina Mueller <tina@streetmail.com> wrote:
>>hi,
>>
>>Tom Phoenix <rootbeer@redcat.com> wrote:
>>> On Tue, 2 May 2000, Tina Mueller wrote:
>>
>>>> maybe you have to put in a backslash to escape the
>>>> whitespace:
>>>> $file = "School\ Trips";
>>
>>> There's no backslash in that string; see the perlop manpage for more
>>> information. Cheers!
>>
>>hm, probably i'm a little bit late with this, but why
>>does this work then? 


> It also works without the backslash, so you don't "have to"
> put in a backslash.

yep, i've forgotten that open can handle this.
and 
`ls $file`;
would not work.
so tom was (of course) right.
it should be 
$file = "School\\ Trips";
if you use backticks.


tina


-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."


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

Date: Thu, 22 Jun 2000 20:42:14 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Editing text file...how?
Message-Id: <sl4uh6iqe7f146@corp.supernews.com>

In article <8itedn$9l9$1@nnrp1.deja.com>,
    Edge  <edge@gecko.org> wrote:

: That definately has some useful info, thanks for the link.  However, I
: still don't see how I can just replace $<some variable> with new data.
: In my colon-deliminated file, one of the "fields" is the state.  Say
: there are 5 instances of "AZ" in the file and I only want to change one
: - how can I do this without changing the rest of the file?

You can't unless you have the luxury of record-oriented files.  If
you change (update, insert, delete) in the middle of a file stream,
you have to rewrite the rest of the file.  If you don't ever want to
do this, then design your format such that all changes are appended.

Greg
-- 
Our game plan is first year, a .500 season. Second year, a conference
championship. Third year, undefeated. Fourth, a national championship.
And by the fifth year, we'll be on probation, of course.
    -- Bear Bryant


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

Date: Thu, 22 Jun 2000 13:20:09 -0700
From: "Stephen Ludin" <sludin@aeneid.com>
Subject: Error in POSIX.pm when using signal handlers
Message-Id: <zuu45.37$5j2.28653@news.pacbell.net>

When I use the below code and run with the'-w' switch I get the following
the first ( and only the first ) time my CHLD signal handler is called:

Argument "CHLD" isn't numeric in subroutine entry at
/usr/local/lib/perl5/5.6.0/alpha-dec_osf/POSIX.pm

Here is a smple script.  It is pretty much textbook code.

------------------------------------------------------
use POSIX ":sys_wait_h";

$SIG{CHLD} = \&sh_child;

# spawn children here

sub sh_child
{
    my $child;

    while( ($child = POSIX::waitpid( -1, &POSIX::WNOHANG )) > 0 )
    {
        # do something with $child and $?
    }

}

Anyone have any ideas?  I am using 5.6.0 on DEC's Tru64 Unix.




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

Date: Thu, 22 Jun 2000 13:32:05 -0700
From: "Ferk Da Jerk" <shawnball@uswest.net>
Subject: Finding the demensions of an image.
Message-Id: <GGs45.521$tr3.19159@news.uswest.net>

I have a site that lets people upload images to my server.  I want to have a
page that shows these pictures but in a certain size.  So lets say I want to
have all the images with the height of 50 px.  Now x is going to equal the
original height of the image.

I would take:

x/50 to get how many times it took it down.

Now lets say X was 100.  It took the height down by 2.
Now Y equals the width of the picture.

I would take

y/2 to get how many pixels the width should be.
But I need to know how to find the origanal height and width of the image.
Does anyone know how to do this?  THANKS




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

Date: Thu, 22 Jun 2000 21:21:00 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Finding the demensions of an image.
Message-Id: <PGt45.1891$PQ4.36469@news1.online.no>


Ferk Da Jerk <shawnball@uswest.net> wrote in message
news:GGs45.521$tr3.19159@news.uswest.net...
> But I need to know how to find the origanal height and width of the
image.
> Does anyone know how to do this?  THANKS

use the module Image::Size

--
Trond Michelsen





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

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


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