[24760] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6913 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 26 09:06:23 2004

Date: Thu, 26 Aug 2004 06:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Aug 2004     Volume: 10 Number: 6913

Today's topics:
    Re: -s vs du - different results <mgjv@tradingpost.com.au>
    Re: creating anonymous subroutines at runtime (Anno Siegel)
        HTML::Parser <zebee@zip.com.au>
    Re: HTML::Parser <tassilo.von.parseval@rwth-aachen.de>
    Re: I Broke a scalar <jurgenex@hotmail.com>
    Re: Larry Wall & Cults <tim@vegeta.ath.cx>
    Re: Larry Wall & Cults <catcher@linuxmail.org>
    Re: Larry Wall & Cults <peter@engcorp.com>
    Re: Larry Wall & Cults (Johnny)
    Re: Larry Wall & Cults <espen@*do-not-spam-me*.vestre.net>
    Re: Larry Wall & Cults <tor.iver.wilhelmsen@broadpark.no>
    Re: Larry Wall & Cults <tassilo.von.parseval@rwth-aachen.de>
    Re: Larry Wall & Cults <borkent@cs.utwente.nl>
    Re: Larry Wall & Cults <peter@engcorp.com>
    Re: Larry Wall & Cults <pete@fenelon.com>
    Re: Larry Wall & Cults <borkent@cs.utwente.nl>
    Re: Larry Wall & Cults (Sara)
    Re: Larry Wall & Cults (norman werner)
        matching chunks of data with a regular expression (Leif Wessman)
        need a good tutorial <webmaster @ infusedlight.net>
    Re: need a good tutorial <jkeen_via_google@yahoo.com>
    Re: Parsing FileName for upload (jon)
    Re: Parsing FileName for upload <tore@aursand.no>
    Re: Parsing FileName for upload <nobull@mail.com>
    Re: Parsing FileName for upload <tore@aursand.no>
    Re: Parsing FileName for upload $_@_.%_
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 26 Aug 2004 06:34:59 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: -s vs du - different results
Message-Id: <slrncir14i.47i.mgjv@verbruggen.comdyn.com.au>

On 25 Aug 2004 06:55:32 GMT,
	Sam Holden <sholden@flexal.cs.usyd.edu.au> wrote:
> On 25 Aug 2004 06:39:29 GMT, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>> On Wed, 25 Aug 2004 05:18:42 GMT,
>> 	Zebee Johnstone <zebee@zip.com.au> wrote:
>>> In comp.lang.perl.misc on Wed, 25 Aug 2004 04:31:43 GMT
>>> Jürgen Exner <jurgenex@hotmail.com> wrote:
>>>> 
>>>>> That's a huge discrepancy, so
>>>>> there's something that's not being counted.
>>>> 
>>>> Not at all. It's just the trivial fact that usually the size of a file and
>>>> the amount of disk space it occupies are not identical and in some cases can
>>>> be very different, e.g. for sparse files.
>>> 
>>> Which is something not being counted :)  If only unused blocks...
>>> 
>>> I want to take enough files to fit on a CD and put those files in 
>>> a directory and then make an CD from the directory.
>>> 
>>> If -s won't do it, what will?  Or do I just use du in backticks?
>>
>> Have you tried 
>>
>> my ($block_size, $blocks) = (stat $_)[11, 12];
>> my $du_size = $block_size * $blocks;
>>
>> If your find doesn't span multiple file systems, $block_size probably
>> is constant, and you can optimise that out. Even if you span multiple
>> file systems, the chance is still high that $block_size is constant.
> 
> On my system multiplying those two numbers doesn't work.
> 
> ; echo a >test.file
> ; perl -le 'print join "\t", (stat "test.file")[11, 12]'
> 4096    8

That's correct. I was wrong. The block size in stat is not the size of
the blocks on disk, but the size of the file system I/O preferred
block read.

The nblocks field gives the count in blocks of 512 bytes, as in the
block size on the original UFS.

> I'd still argue that taking the file size and rounding up to
> a multiple of the blocksize of the CD file system you are
> going to create is the only correct approach. But I 
> know next to nothing about the specifics of those file
> systems so there could be tail packing or something to
> ruin that approach...

(stat $_)[12] * 512 should, I believe, work on all Unix systems. It
seems to work on both the Linux and the Solaris system I've got here.
However, it does not work the same way under Cygwin, where the
multiplication rule that I came up with earlier holds up.

It looks like as long as you know what the "fundamental" block size of
your file system is, you can translate the number of blocks to space
taken up on the file system.

Since, indeed, the idea seems to be that these files are going to be
packed onto a CD, using the block size of the ISO9660 file system in
the way you describe should be ok. I don't know whether it's easy to
predict what directory sizes and such will be.

Martien
-- 
                        | 
Martien Verbruggen      | Freudian slip: when you say one thing but
Trading Post Australia  | mean your mother.
                        | 


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

Date: 26 Aug 2004 10:23:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <cgkdml$fqj$1@mamenchi.zrz.TU-Berlin.DE>

Randal L. Schwartz <merlyn@stonehenge.com> wrote in comp.lang.perl.misc:
> >>>>> "Arne" == Arne Gödeke <cpyfykf02@sneakemail.com> writes:
> 
> Arne> I posted an example of the problem. The $callback may change 
> Arne> afterwards and so does $callback in the new subroutine which 
> Arne> is expected behaviour. I want to avoid that. To indicate
> Arne> that I used double-quotes.. I want $callback inside the new
> Arne> anonymous sub to be a copy of the original $callback so it
> Arne> does never change.
> 
> Then use a closure.
> 
>     my $callback = sub {
>         print "Hello World\n";
>     };
>     ...
>     my $cb = do { my $temp = $callback; eval 'sub { $temp->() }' };
>     $callback = "goofy stuff"; # but this doesn't affect $cb now
>     $cb->(); # says hello world!

Why the string-eval?

    my $cb = do { my $temp = $callback; sub { $temp->() } };

works just as well.

Anno


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

Date: Thu, 26 Aug 2004 05:00:35 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: HTML::Parser
Message-Id: <slrnciqr95.cjj.zebee@zeus.zipworld.com.au>

Are there any tutorials or explanations of HTML::Parser?  

I've read the perldoc and I don't understand it.  It's gibberish to me.

I've looked at the examples, but using them is cargo cult programming at
its worst, I have no idea what they are doing and why.

I understand I create an object.  I understand I can then use this to do
things, but as soon as it talks about handlers, it loses me.

So I look at the code in the examples dir, and hanchors appears to be
the closest to what I want to do - which is get a set of links and their
associated text.  But it appears to possibly be recursing, it's getting
things passed that appear to be hashes to the subroutines, but are
passed as strings....

I want to understand it, to work through it, so I can make my own or
modify it but can't work out what it's doing.  I don't get the program
flow.  I think because I don't see how it reads the files or works
out $attr->{href} (or why that's a bare word), or if start_handler's
being called once or many times.  Or really what's happening at all!





#!/usr/bin/perl -w

# This program will print out all <a href=".."> links in a
# document together with the text that goes with it.

use HTML::Parser;

my $p = HTML::Parser->new(api_version => 3,
     start_h => [\&a_start_handler, "self,tagname,attr"],
     report_tags => [qw(a img)],
    );


$p->parse_file(shift || die) || die $!;

sub a_start_handler
{
    my($self, $tag, $attr) = @_;
    return unless $tag eq "a";
    return unless exists $attr->{href};
    print "A $attr->{href}\n";

    $self->handler(text  => [], '@{dtext}' );
    $self->handler(start => \&img_handler);
    $self->handler(end   => \&a_end_handler, "self,tagname");
}

sub img_handler
{
    my($self, $tag, $attr) = @_;
    return unless $tag eq "img";
    push(@{$self->handler("text")}, $attr->{alt} || "[IMG]");
}

sub a_end_handler
{
    my($self, $tag) = @_;
    my $text = join("", @{$self->handler("text")});
    $text =~ s/^\s+//;
    $text =~ s/\s+$//;
    $text =~ s/\s+/ /g;
    print "T $text\n";

    $self->handler("text", undef);
    $self->handler("start", \&a_start_handler);
    $self->handler("end", undef);
}


Zebee

-- 
Zebee Johnstone (zebee@zip.com.au), proud holder of
aus.motorcycles Poser Permit #1.
"Motorcycles are like peanuts... who can stop at just one?"


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

Date: Thu, 26 Aug 2004 07:46:55 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: HTML::Parser
Message-Id: <2p5bqhFgupgrU1@uni-berlin.de>

Also sprach Zebee Johnstone:

> Are there any tutorials or explanations of HTML::Parser?  
> 
> I've read the perldoc and I don't understand it.  It's gibberish to me.
> 
> I've looked at the examples, but using them is cargo cult programming at
> its worst, I have no idea what they are doing and why.
> 
> I understand I create an object.  I understand I can then use this to do
> things, but as soon as it talks about handlers, it loses me.

One problem with HTML::Parser appears to be its two available
interfaces. The description of the provided methods in the perldocs
isn't always quite clear about which API version a method relates to.

Maybe

    <http://www.unisolve.com.au/perlmeme/tutorials/html_parser.html>

will help you. It deals with the old interface (subclassing) which I
find more convenient and easier to use.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Thu, 26 Aug 2004 02:22:54 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: I Broke a scalar
Message-Id: <2QbXc.530$vY6.184@nwrddc02.gnilink.net>

no@no.invalid wrote:
> Can this be done?  Should right?  Well its not working =(
> What's goin on?
>
> my $a = '
> $VAR1 = bless( {
>                   'read_limit' => 3000,
[rest of script snipped]

Well, I don't know what you intended to do, but I get a syntax error

    Bad name after read_limit' at t.pl line 3.

What I don't get is why this surprises you.
Maybe you forgot to close the string in the first line?

jue




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

Date: Thu, 26 Aug 2004 01:54:19 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Larry Wall & Cults
Message-Id: <slrnciqgp3.j8f.tim@vegeta.saiyix>

Xah Lee <xah@xahlee.org> wrote: [stuff]

Why was Larry's name in the title again?  I don't think our illustrious
OP got around to making his point.  But at least he got that Nazi
mention in there.  Good for him!

Tim Hammerquist


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

Date: Wed, 25 Aug 2004 22:12:59 -0400
From: "Robert" <catcher@linuxmail.org>
Subject: Re: Larry Wall & Cults
Message-Id: <VJOdnfiBTci22rDcRVn-gg@adelphia.com>

Isn't "Xah Lee" chinese for "Moron"?




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

Date: Thu, 26 Aug 2004 02:11:34 -0400
From: Peter Hansen <peter@engcorp.com>
Subject: Re: Larry Wall & Cults
Message-Id: <aNidnUSV4-OK4rDcRVn-jA@powergate.ca>

Robert wrote:

> Isn't "Xah Lee" chinese for "Moron"?

No, it's Esperanto (universal language) for "troll"...

-Peter


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

Date: 25 Aug 2004 23:57:24 -0700
From: spam_depository2004@yahoo.com (Johnny)
Subject: Re: Larry Wall & Cults
Message-Id: <2a56f6a3.0408252257.4f1f92e@posting.google.com>

xah@xahlee.org (Xah Lee) wrote in message news:<7fe97cc4.0408251356.34f2102a@posting.google.com>...

> How can we prevent heinous cults then? Stop bending truths. Education
> and rationalism. I'm starting my own cult to exterminate morons on
> this earth.  Two things are on the top of my agenda: Unixism and Perl.

I bet Larry Wall's life insurance premiums just skyrocketed. BTW, what
does this have to do with Lisp? We are more of a therapy and support
group than a cult.


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

Date: Thu, 26 Aug 2004 09:12:58 +0200
From: Espen Vestre <espen@*do-not-spam-me*.vestre.net>
Subject: Re: Larry Wall & Cults
Message-Id: <kw1xhujrt1.fsf@merced.netfonds.no>

Rich Teer <rich.teer@rite-group.com> writes:

> I think you're getting confused with the Blue Öyster Cult.
> Don't Fear the Reaper - great song.

Great song, but their hard-hitting stuff is even better. For instance
"Lisp in the Hills" or "Career of Eval".
-- 
  (espen ;-)


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

Date: 26 Aug 2004 09:44:17 +0200
From: Tor Iver Wilhelmsen <tor.iver.wilhelmsen@broadpark.no>
Subject: Re: Larry Wall & Cults
Message-Id: <upt5eibse.fsf@broadpark.no>

Rich Teer <rich.teer@rite-group.com> writes:

> I think you're getting confused with the Blue Öyster Cult.

Actually, there is also The Cult, a British band that lasted from
1984-1995.

http://www.allmusic.com/cg/amg.dll?p=amg&sql=11:5qktk6gx9kr3~T1


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

Date: Thu, 26 Aug 2004 09:49:48 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Larry Wall & Cults
Message-Id: <2p5j10FesankU1@uni-berlin.de>

Also sprach Johnny:

> xah@xahlee.org (Xah Lee) wrote in message news:<7fe97cc4.0408251356.34f2102a@posting.google.com>...
> 
>> How can we prevent heinous cults then? Stop bending truths. Education
>> and rationalism. I'm starting my own cult to exterminate morons on
>> this earth.  Two things are on the top of my agenda: Unixism and Perl.
> 
> I bet Larry Wall's life insurance premiums just skyrocketed. 

It would, if anyone could take Xah Lee Loo seriously. But really, no one
can. He's more like the court jester, creeping out of the dark every so
and so months. We're all very much enjoying his sporadic shows. Really. 

;-)

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Thu, 26 Aug 2004 13:00:34 +0200
From: "Michiel Borkent" <borkent@cs.utwente.nl>
Subject: Re: Larry Wall & Cults
Message-Id: <cgkfs3$b87$1@ares.cs.utwente.nl>

Erm, please don't make false propaganda for the language I happen to love
;).

Btw:

(english-to-esperanto "troll") ==> "trolo"

Michiel

"Peter Hansen" <peter@engcorp.com> wrote in message
news:aNidnUSV4-OK4rDcRVn-jA@powergate.ca...
> Robert wrote:
>
> > Isn't "Xah Lee" chinese for "Moron"?
>
> No, it's Esperanto (universal language) for "troll"...
>
> -Peter



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

Date: Thu, 26 Aug 2004 07:11:57 -0400
From: Peter Hansen <peter@engcorp.com>
Subject: Re: Larry Wall & Cults
Message-Id: <Nbudnes8cfDjWLDcRVn-sA@powergate.ca>

Michiel Borkent wrote:

> "Peter Hansen" <peter@engcorp.com> wrote:
>>No, it's Esperanto (universal language) for "troll"...

> Erm, please don't make false propaganda for the language I happen to love
> ;).
> 
> Btw:
> 
> (english-to-esperanto "troll") ==> "trolo"

Pardonu... estis sxerco, evidente!

-Peter


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

Date: Thu, 26 Aug 2004 12:18:09 +0100
From: Pete Fenelon <pete@fenelon.com>
Subject: Re: Larry Wall & Cults
Message-Id: <htgkgc.6vu.ln@fenelon.com>

In alt.folklore.computers Giles Todd <g@prullenbak.todd.nu> wrote:
> 
> That's OK.  I've done it for you.  Now, try investigating "Rambling
> Sid Rumpo".
> 

I need to fossick through me ganderbag and work out a way of mp3ing my
taped collection of Rambling Syd's artefacts, me dearios.

pete
-- 
pete@fenelon.com "there's no room for enigmas in built-up areas"


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

Date: Thu, 26 Aug 2004 13:35:38 +0200
From: "Michiel Borkent" <borkent@cs.utwente.nl>
Subject: Re: Larry Wall & Cults
Message-Id: <cgkhtp$duf$1@ares.cs.utwente.nl>

Jes, mi komprenis. Dankon por la inspiro: mi jxus kreis novan subskribajxon.

Amike,
Michiel
-- 
LISP and Esperanto: my favorite languages.
Visit http://www.pictureofthemoon.net/~borkent  for my webpage.
---

"Peter Hansen" <peter@engcorp.com> wrote in message
news:Nbudnes8cfDjWLDcRVn-sA@powergate.ca...
> Michiel Borkent wrote:
>
> > "Peter Hansen" <peter@engcorp.com> wrote:
> >>No, it's Esperanto (universal language) for "troll"...
>
> > Erm, please don't make false propaganda for the language I happen to
love
> > ;).
> >
> > Btw:
> >
> > (english-to-esperanto "troll") ==> "trolo"
>
> Pardonu... estis sxerco, evidente!
>
> -Peter



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

Date: 26 Aug 2004 05:33:32 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: Larry Wall & Cults
Message-Id: <776e0325.0408260433.449660c8@posting.google.com>

xah@xahlee.org (Xah Lee) wrote in message news:<7fe97cc4.0408251356.34f2102a@posting.google.com>...
> Larry Wall and Cults
> (Lazyness, Impatience and Hubris)
> 200012
> 
> Dear readers,
> 
> Did you know that throughout history there's this thing called cult?
> It is a very interesting phenomenon. I don't have time to expound and
> teach, but will try to brief you.
> 
>

Hey this ain't no CULT! Our creedo is simply:

   "Larry said it, I believe it, THAT settles it!"

If you don't believe it just look at the reaction if any questions any
element of Perl design!


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

Date: 26 Aug 2004 06:03:53 -0700
From: norman.werner@student.uni-magdeburg.de (norman werner)
Subject: Re: Larry Wall & Cults
Message-Id: <b301fb47.0408260503.5dbb08f5@posting.google.com>

Peter Hansen <peter@engcorp.com> wrote in message news:<aNidnUSV4-OK4rDcRVn-jA@powergate.ca>...
> Robert wrote:
> 
> > Isn't "Xah Lee" chinese for "Moron"?
> 
> No, it's Esperanto (universal language) for "troll"...
> 
> -Peter

Bonvolu ne s:ercu pri nekonatoj aferoj. "Xah Lee" certe - pro manko de
Ikso - ne estas esperanto. Kaj via s:erco nur s:tulta estas.


Norman
tradukita:
You certainly have not the slightest idea about esperanto. So please 
dont't emberass yourself. And back to topic(?): "Xah lee" is not
esperanto.


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

Date: 26 Aug 2004 06:02:27 -0700
From: leifwessman@hotmail.com (Leif Wessman)
Subject: matching chunks of data with a regular expression
Message-Id: <64beeaad.0408260502.60aac77c@posting.google.com>

Hi!

I'm using LWP::Parallel to create several parallel requests. I would
like to handle the result from each reqest as it come. So, I've
registered a callback function to the user agent, like this:

my $res = $ua->register($req, \&callback);

In the callback function I would like to use a regular expression that
matches 9 digits. This is what I have:

sub callback {
     my($chunk,$response,$protocol) = @_;
     $chunk =~ /(\d{9})/;
     ...
}

What I wonder is what happens if I get a chunk that ends with "12345",
and the next chunk starts with "6789". Will it get matched? If not,
how can I change my code so it matches "123456789" even if it's in two
different chunks?

Thanks for any input.

Leif


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

Date: Wed, 25 Aug 2004 22:31:51 -0600
From: "Robin" <webmaster @ infusedlight.net>
Subject: need a good tutorial
Message-Id: <q5idnbGVzKE8-rDcRVn-pA@comcast.com>

I was looking for tutorials on google for writing perl modules, and all I
could find is the basics with the first few tries, and I figured the best
ones would be from word of mouth from some more experienced coders, perhaps
even ones written by these people, I don't have the money to invest in books
now- when I get it I'll buy randals book, "Learning Perl Objects References
and Modules", but for now I was wondering if  someone could hook me up with
a good link to a more intermediate/advanced tutorial on building modules
which starts with the basics and then moves into this, the perldocs have
utterly confused me, for now I dunno... on a side note, anyone know exactly
how to get the cygwin/x to run with multiple windows, have tried everything
on their website and another one.

-- 
Robin
--
webmaster@infusedlight.net
--




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

Date: Thu, 26 Aug 2004 11:51:34 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: need a good tutorial
Message-Id: <a9kXc.17247$oD2.12121@trndny08>

Robin wrote:
> I was looking for tutorials on google for writing perl modules, and all I
> could find is the basics with the first few tries, 

[snip]

> but for now I was wondering if  someone could hook me up with
> a good link to a more intermediate/advanced tutorial on building modules
> which starts with the basics and then moves into this, the perldocs have
> utterly confused me

Many of us learned how to write modules through the docs.  Could you let 
us know exactly what you find utterly confusing about them, specifically:

     perldoc perlnewmod

jimk


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

Date: Thu, 26 Aug 2004 03:09:09 -0700
From: xbg86@webtv.net (jon)
Subject: Re: Parsing FileName for upload
Message-Id: <15381-412DB6C5-185@storefull-3317.bay.webtv.net>

#!/usr/bin/perl -w

$file='C:\Documents and Settings\My Pictures\pic1.jpg';

$file=~s/.*[\/\\](.*)/$1/;
# result: $file="pic1.jpg"

:)



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

Date: Thu, 26 Aug 2004 12:56:06 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Parsing FileName for upload
Message-Id: <pan.2004.08.26.10.56.06.668863@aursand.no>

On Thu, 26 Aug 2004 03:09:09 -0700, jon wrote:
> #!/usr/bin/perl -w
> 
> $file='C:\Documents and Settings\My Pictures\pic1.jpg';
> 
> $file=~s/.*[\/\\](.*)/$1/;
> # result: $file="pic1.jpg"

Don't do this.  What happends if the separator is something different
than '/' or '\'?

Use the File::Basename module, for God's sake!


-- 
Tore Aursand <tore@aursand.no>
"Why shouldn't truth be stranger than fiction? Fiction, after all, has
 to make sense." (Mark Twain)


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

Date: Thu, 26 Aug 2004 12:07:27 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Parsing FileName for upload
Message-Id: <cgkg1f$ai1$1@sun3.bham.ac.uk>



Tore Aursand wrote:
> On Thu, 26 Aug 2004 03:09:09 -0700, jon wrote:
> 
>>#!/usr/bin/perl -w
>>
>>$file='C:\Documents and Settings\My Pictures\pic1.jpg';
>>
>>$file=~s/.*[\/\\](.*)/$1/;
>># result: $file="pic1.jpg"
> 
> 
> Don't do this.  What happends if the separator is something different
> than '/' or '\'?
> 
> Use the File::Basename module, for God's sake!

Bzzzt!  That doesn't help.  File::Basename parses (by default) acording 
to the local OS's syntax.  Since we're talking here about filnames 
comming from a remote computer running a potentially different OS this 
is worse than useless.



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

Date: Thu, 26 Aug 2004 14:07:45 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Parsing FileName for upload
Message-Id: <pan.2004.08.26.12.07.44.757299@aursand.no>

On Thu, 26 Aug 2004 12:07:27 +0100, Brian McCauley wrote:
>> Use the File::Basename module, for God's sake!

> Bzzzt!  That doesn't help.  File::Basename parses (by default) acording
> to the local OS's syntax.  Since we're talking here about filnames
> comming from a remote computer running a potentially different OS this
> is worse than useless.

Damn!  You're so right.  My fault not thinking of that, of course.  But
there must be (a) module(s) which is safer than the approached solution?


-- 
Tore Aursand <tore@aursand.no>
"When you love someone, all your saved-up wishes start coming out."
 (Elizabeth Bowen)


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

Date: Thu, 26 Aug 2004 12:15:54 GMT
From: $_@_.%_
Subject: Re: Parsing FileName for upload
Message-Id: <_vkXc.9357$Ff2.7974@trndny06>


Tore Aursand <tore@aursand.no> wrote in message-id:
<pan.2004.08.26.12.07.44.757299@aursand.no>
>
>On Thu, 26 Aug 2004 12:07:27 +0100, Brian McCauley wrote:
>>> Use the File::Basename module, for God's sake!
>
>> Bzzzt!  That doesn't help.  File::Basename parses (by default) acording
>> to the local OS's syntax.  Since we're talking here about filnames
>> comming from a remote computer running a potentially different OS this
>> is worse than useless.
>
>Damn!  You're so right.  My fault not thinking of that, of course.  But
>there must be (a) module(s) which is safer than the approached solution?
>
>

Sorry if this is not relevant, but perhaps the module Path-Class may be
helpfull.

gl




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6913
***************************************


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