[13533] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 943 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 29 12:07:16 1999

Date: Wed, 29 Sep 1999 09:05:11 -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: <938621111-v9-i943@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 29 Sep 1999     Volume: 9 Number: 943

Today's topics:
    Re: a question of buttons jlsimms@hotmail.com
    Re: Advice wanted: Creating an .exe <bivey@teamdev.com>
        Can in UNIX, But How in Perl <g-preston1@ti.com>
    Re: CONTEST: Range Searching <tchrist@mox.perl.com>
    Re: deprecated $[ <gellyfish@gellyfish.com>
    Re: deprecated $[ <uri@sysarch.com>
    Re: Exclusive open()? <aqumsieh@matrox.com>
    Re: Expert question: wrapping a subroutine (Johan Vromans)
        form to mail script for NT <james@videosoftwareltd.com>
        Form to Mail Script on NT. How? <james@videosoftwareltd.com>
    Re: How to append an extension to a value in a variable (Henry Penninkilampi)
    Re: hyperlink submits <msfrost@celluloidnexus.com>
    Re: Insert blank line between two lines? (Mark A. Hershberger)
    Re: kill extra white space in a variable <crt@kiski.net>
    Re: kill extra white space in a variable <crdevilb@mtu.edu>
    Re: newline problem w/ CGI on NT (Larry Rosler)
    Re: Perl & PDF (Mark A. Hershberger)
    Re: Perl Question (Henry Penninkilampi)
        perl routine to emulate "find . -ls" command?? <dennis.moreno@pop.safetran.com>
        Perl Telnet to a system not needing login id or pw <jaybaker@cisco.com>
    Re: Please compare and contrast C and Perl. <uri@sysarch.com>
    Re: Question from a starter <rhomberg@ife.ee.ethz.ch>
    Re: RedHat Linux 6.0 and Perl 5.005_03 <rhomberg@ife.ee.ethz.ch>
    Re: RedHat Linux 6.0 and Perl 5.005_03 <gellyfish@gellyfish.com>
    Re: Sorting weird numeric data <uri@sysarch.com>
    Re: Sorting weird numeric data <uri@sysarch.com>
    Re: Using Net::Ping troubles <gellyfish@gellyfish.com>
    Re: Using system() and directory name with white space <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 29 Sep 1999 15:20:28 GMT
From: jlsimms@hotmail.com
Subject: Re: a question of buttons
Message-Id: <7stanc$6sa$1@nnrp1.deja.com>

David,
    I had replied to you very early on that a.) the solution did not lie
within Perl, and b.) I pointed you where to go to find the answer.  As
others have pointed out, the crux of the solution lies within the naming
scheme of your buttons within the HTML itself.  However, this is only
most of the solution.  The trick is whatever tool you choose to use to
extract and parse that information, which _can_ be Perl (though CGI), or
any one of several other languages.  All of these items are discussed in
comp.infosystems.www.authoring.cgi.

    I am not a fan of how Abigail, and some others, sometimes respond to
what they feel are inappropriate, stupid, off-topic, or what have you,
questions.  For instance, she did inform you that your question was
off-topic, but she failed to inform you where you might best find the
answer.  I find that this often happens, and it is unfortunate.  The
person asking the question is left just as bewhildered and lost as when
they came in...  And you're right: that's not productive or helpful.
The problem came when I _did_ point you in the right direction, and you
failed to take the question there.  You thanked me for my answer, but
kept right on in a useless insult battle.  Abigail, and others, are
exceptionally talented Perl programmers.  Even if their advice is
sometimes brazen, they were here long before you, and more often than
not, they are right, even if they sometimes have an interesting way of
putting it.  Next time, heed the advice of your peers.  We are happy to
help with Perl questions.  You may not like the response you receive all
the time, but that is the price you may pay for throwing your questions
to the wind.  Before you post anywhere, make sure you have exhausted all
that is available to you: man pages, docs, books, etc.  When you post,
post your code, what is wrong, what you thought it should do, what it is
doing, etc.  Then, and only then, will you have a good chance of having
a lucid answer presented to you.

Good luck with your code.

Jason Simms


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


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

Date: 29 Sep 1999 16:03:39 GMT
From: "William" <bivey@teamdev.com>
Subject: Re: Advice wanted: Creating an .exe
Message-Id: <01bf0a94$5e856020$3527e1ce@bill.jump.net>

Abigail <abigail@delanet.com> wrote in article
<slrn7v2u50.9kl.abigail@alexandra.delanet.com>...
> Wrong. Solution2 is to ship LWP as well. No Perl distribution comes
> with LWP anyway.

I believe _their_ current install package does include it, but,
in any case, it's not an option (not my choice). It's moot since
I now have two viable solutions (one I rolled yesterday, and one
Mr. Schwartz kindly put me onto: wget). -Wm



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

Date: Wed, 29 Sep 1999 10:01:58 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: Can in UNIX, But How in Perl
Message-Id: <37F229E6.4A925BB@ti.com>

In UNIX I can do the following:

    cd */9181339

and UNIX will change directory correctly.

How can I do this in Perl.

Thanks,

Jerry



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

Date: 29 Sep 1999 08:18:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: CONTEST: Range Searching
Message-Id: <37f21fbd@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.moderated, 
    Joe Seigh <jseigh@bbnplanet.com> writes:
:First time I've had to use a closure, regexp ranges have state
:information.
:I've been burned by that before.  I assume that if you made it a
:subroutine
:with a block prototype parameter it would handle the regexp state
:correctly,
:but I haven't tried it out.

You've done something wrong.  And so has the moderator
who let thourgh this miswrapped posting.  Please check
your newsreader.

--tom
-- 
When in doubt, mumble.


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

Date: 29 Sep 1999 16:19:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: deprecated $[
Message-Id: <37f22e1b_2@newsread3.dircon.co.uk>

Tracey Hughes <TH@Dymaxion.ca> wrote:
> 
> I was wondering if anyone knows why exactly the $[ variable was deprecated
> after release 5.
> 

Its use wasnt exactly encouraged under Perl 4 either ...

/J\
-- 
"Enter the Great Jaffa Cakes Debate. In these jam-filled concoctions
were cakes they would escape VAT. Because they are soft and not hard,
they were deemed to be cakes and therefore VAT free. In 1974 Master of
the Universe asked the VAT tribunal to exempt him from VAT because he
is the Supreme Authority in the Universe and therefore should not pay
it. He lost his case" - BBC News Website


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

Date: 29 Sep 1999 11:46:24 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: deprecated $[
Message-Id: <x7iu4twwj3.fsf@home.sysarch.com>

>>>>> "TH" == Tracey Hughes <TH@Dymaxion.ca> writes:

  TH> I was wondering if anyone knows why exactly the $[ variable was
  TH> deprecated after release 5.

can you think of a good reason to use it? the powers that be thought
there was none and it was open to abuse.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 29 Sep 1999 10:57:53 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Exclusive open()?
Message-Id: <x3yaeq5vk7i.fsf@tigre.matrox.com>


paulco44213@my-deja.com writes:

> Is it possible to exclusively open a file with perl, such that any
> other open()s by other perl scripts running at the same time will fail?

You mean "locking" your file? Checkout flock() in perlfunc.

HTH,
--Ala



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

Date: Wed, 29 Sep 1999 17:37:53 +0200 (MEST)
From: JVromans@squirrel.nl (Johan Vromans)
Subject: Re: Expert question: wrapping a subroutine
Message-Id: <14322.12881.8868.676027@phoenix.squirrel.nl>

Hi Anno,

At first I was to agree with Abigail, since I've been trying things
like this for several hours. But it turned out that your suggestion is
perfectly allright! Abigails solution works also.

Thanks, both of you.

-- Johan



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

Date: Wed, 29 Sep 1999 11:13:23 -0400
From: James Bodajlo <james@videosoftwareltd.com>
Subject: form to mail script for NT
Message-Id: <37F22C93.A17626EB@videosoftwareltd.com>

I am in need of a perl script which will take the info from an HTML form
and send it via e-mail. I have one that works on UNIX, but I need it to
work on an NT server. Please help me.

James



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

Date: Wed, 29 Sep 1999 11:45:35 -0400
From: James Bodajlo <james@videosoftwareltd.com>
Subject: Form to Mail Script on NT. How?
Message-Id: <37F2341F.41F26CB0@videosoftwareltd.com>

I am in need of a script which will work on an NT server and takes the
info from an HTML form and sends it via e-mail. I have a script which
works on UNIX, but I need to know what I need to change for it to work
on NT.

James



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

Date: Thu, 30 Sep 1999 00:57:44 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: How to append an extension to a value in a variable
Message-Id: <spamfree-3009990057450001@d5.metropolis.net.au>

In article <37F0F7F4.814666E1@home.com>, David <yngwie@home.com> wrote:

> I need to add an extension (.wav) to a scaler variable value.
> 
> Something like:
> 
> $filename = hello
> $extension = ".wav"
> 
> $value = $filename + $extension


$filename .= $extension;

Henry.


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

Date: Wed, 29 Sep 1999 10:14:01 -0500
From: Michael Frost <msfrost@celluloidnexus.com>
To: James W Corpening <jwc@acsu.buffalo.edu>
Subject: Re: hyperlink submits
Message-Id: <37F22CB9.3C29CB0C@celluloidnexus.com>

You can use the GET cgi method, which for your purposes is probably just a
matter of creating your list of passed parameters right in the HREF of your
<A> tag.

The syntax is: <A
HREF="http://your.domain/<path>/filename.cgi?parameter1=value1&parameter2=value2&etc.">

The stuff to pay attention to here is the "?" which indicates a parameter
list, and basically tells the httpd not to interpret the rest of your HREF
as more path info. The &'s seperate the key value pairs. You'll need to
write a routine called in you cgi to handle those. A good routine that I've
used can be found in the O'Reilley CGI Programming book. Perl::CGI should
also have something that does that parsing.

Hope this helps.

Mike Frost

James W Corpening wrote:

> Hi.
> I've searched the FAQs, perl.com, and other places, but I haven't found
> a hint as to how to make a hyperlink work as a submit button.  Is it
> possible (I sorta remember seeing instructions, somewhere)?  If so, how?
>
> Thank you.
> -jc





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

Date: 29 Sep 1999 10:22:19 -0500
From: mah@everybody.org (Mark A. Hershberger)
Subject: Re: Insert blank line between two lines?
Message-Id: <49iu4tagk4.fsf@playpen.baileylink.net>

[mailed and posted]

Jason.Breitweg@blind-guardian.com (Jason T. Breitweg) writes:

> I have a bunch of lines (my CD list actually) and I want to put a new
> line between lines that have a different first character.  For example
> the original file would look like:
> 
> Blind Guardian - Imaginations from the Other Side
> Blind Guardian - Nightfall in Middle Earth
> Dream Theater - Falling Into Infinity
> 
> and I would like it to become:
> 
> Blind Guardian - Imaginations from the Other Side
> Blind Guardian - Nightfall in Middle Earth
> 
> Dream Theater - Falling Into Infinity


Hmm..  Hashes and split are your friend.

---- cut here ----
my ($artist, $title, $cd);
while(<>) {

    # Seperate the artist and the title.
    ($artist, $title) = split / - /;

    # create a hashref of arrays.
    # giving us $cd->{Blind Guardian}->{["Imagninations...", "Nightfall..."]}
    push @{$cd->{$artist}}, $title;
}

foreach (keys %$cd) {
    my $art = $_;
    print map {"$art - $_"} @{$cd->{$_}};
    print "\n";
}
---- cut here ----

That should do it.

Mark.


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

Date: Wed, 29 Sep 1999 11:05:20 -0400
From: "Casey R. Tweten" <crt@kiski.net>
Subject: Re: kill extra white space in a variable
Message-Id: <Pine.OSF.4.10.9909291102480.4735-100000@home.kiski.net>

On Wed, 29 Sep 1999, Tom Briles wrote:

:David Amann wrote:
:> 
:> I don't know what's causing the phantom space, but here's a quick code
:> snippet to get leading or trailing whitespace from your string.
:> 
:> $string =~ s/^\s+//;
:> $string =~ s/\s$//;
:> 
:> Hope this helps,
:> -=dav
:
:$string =~ s/^\s+//;
:$string =~ s/\s+$//;

You don't need two lines.  Can we add this to the FAQ?

$_ = '    space space   ';
s/(^\s*|\s*$)//g;

have fun!

-- 
   Casey R. Tweten    <joke> This
    Web Developer      is 100% certified
HighVision Associates    virus and bug
 crt@highvision.com     free code. </joke>




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

Date: 29 Sep 1999 16:00:33 GMT
From: "Colin R. DeVilbiss" <crdevilb@mtu.edu>
Subject: Re: kill extra white space in a variable
Message-Id: <7std31$e3$1@campus3.mtu.edu>

Casey R. Tweten <crt@kiski.net> wrote:
> On Wed, 29 Sep 1999, Tom Briles wrote:

> :David Amann wrote:

> :$string =~ s/^\s+//;
> :$string =~ s/\s+$//;

> You don't need two lines.  Can we add this to the FAQ?

> $_ = '    space space   ';
> s/(^\s*|\s*$)//g;

see the faq for why NOT to do this. :)

Colin DeVilbiss
crdevilb@mtu.edu


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

Date: Wed, 29 Sep 1999 07:57:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newline problem w/ CGI on NT
Message-Id: <MPG.125bc8aa1785e288989ffb@nntp.hpl.hp.com>

In article <7srvje$8g9$1@nnrp1.deja.com> on Wed, 29 Sep 1999 03:04:20 
GMT, dolgoldur@my-deja.com <dolgoldur@my-deja.com> says...
> I'm trying to have a cgi script read a gif file under NT and have it
> "echoed" back to the browser. Replacement of the \r\n with \n does not
> seem to work appropriately for all gifs.

perldoc -f binmode

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


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

Date: 29 Sep 1999 10:38:37 -0500
From: mah@everybody.org (Mark A. Hershberger)
Subject: Re: Perl & PDF
Message-Id: <49emfhafsy.fsf@playpen.baileylink.net>

[mailed and posted]

Arved_37@chebucto.ns.ca (Arved Sandstrom) writes:

> In article <37F0B8ED.52C91726@qama.fr>, PL Lamballais
> <pl.lamballais@qama.fr> wrote:

> > I'm looking for a Perl 5 library in order to generate PDF files on
> > the fly.  I've found some libraries allowing generation with text
> > and poor graphism like bar, pie and so on, but I want to add
> > pictures inside the document.  Do you know where I can find that?

> Your wish may be for Perl, but sometimes you have to be
> flexible. :-) I could be wrong, but I'm not aware of any Perl
> scripts or modules that address more than text->PDF. Your best bets
> for more functionality right now are C libraries - there are a
> number (I like ClibPDF).

I've not tried this, so I may be incorrect.  But ImageMagick
(http://www.wizards.dupont.com/cristy/ImageMagick.html) has a perl
interface and does PDF.  PL should be able to use perl to create PDF
files.

Additionally, I would recommend "Programming Web Graphics" by Shawn
P. Wallace.  It contains a lot of great information on how to use Perl
to do a lot of different graphics formats.  (I was a technical
reviewer for the book.)

Hope this helps,

Mark.


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

Date: Thu, 30 Sep 1999 01:11:18 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: Perl Question
Message-Id: <spamfree-3009990111190001@d5.metropolis.net.au>

In article <7sr9mv$p7h$1@nnrp1.deja.com>, rthomp41@ford.com wrote:

> I am trying to do the following:
> 
> 1) drop the ? from the end of the line.
> 2) split the remaining 'gridSearch/pgHomeDefault' into
>     two variables containing the following:

Lookup:

chomp()
chop()

and

split()

in the index of Programming Perl.

Henry.


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

Date: Wed, 29 Sep 1999 15:45:09 GMT
From: dennis <dennis.moreno@pop.safetran.com>
Subject: perl routine to emulate "find . -ls" command??
Message-Id: <37F233F2.E8DF7CE1@pop.safetran.com>

Does anyone know of a simple routine to emulate find . -ls?

Dennis


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

Date: Wed, 29 Sep 1999 11:27:21 -0400
From: Jay Baker <jaybaker@cisco.com>
Subject: Perl Telnet to a system not needing login id or pw
Message-Id: <37F22FD9.2645D055@cisco.com>

Has anyone tried this? I have a need to
do so, but have not been
successful. The problem is that I need
the IP address and port, but
no userid or password to pass the
"login" method. When I telnet
into the machine manually, I don't need
a
userid/password. But apparently
the telnet Perl package requires I give
it something in the login
call. Any ideas? 

I am new to Perl prog... so please be
gentle!

Jay


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

Date: 29 Sep 1999 11:33:53 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Please compare and contrast C and Perl.
Message-Id: <x7ln9pwx3y.fsf@home.sysarch.com>

>>>>> "N" == Neil  <neil@pacifier.com> writes:

  >> then you should be able to read some perl docs and learn enough to
  >> determine the differences yourself. and the discussion has been
  >> done before and there are plenty of site which cover it. so posting
  >> the question here is not appropriate. at least it isn't going to
  >> start another perl vs. python/java/c/etc

  N> The purpose of my question was not to determine which of the
  N> languages people think is better, nor was it intended to start a
  N> religious war. And I didn't mention Python or Java.


i was making a point which you didn't get. asking for comparisons of
languages on usenet is almost always flame war fodder. maybe comapring a
particular feature would work but asking about whole languages is too
much and there are to many zealots out there. at least you
didn't crosspost to comp.lang.c

  N> I did not ask, "Which is better, Perl or python/java/c/etc?"

i never said you did. you have to learn to follow threads better.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 29 Sep 1999 17:12:02 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Question from a starter
Message-Id: <37F22C42.88016217@ife.ee.ethz.ch>

Ivo Swartjes wrote:
> 
> I was wondering how a multidimensional array is created in Perl (something
> like @name=((a,b),(c,d),(e,f)) ?  ) and how I can access say the second
> element of the third subarray (which is f in this case)...someone said
> something like $value = @name{3}{2} but that doesn't work...I've tried
> @name[3,2] too, without good results

perldoc perllol

- Alex


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

Date: Wed, 29 Sep 1999 17:11:05 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: RedHat Linux 6.0 and Perl 5.005_03
Message-Id: <37F22C09.72A7B70D@ife.ee.ethz.ch>

news.way.com wrote:
> Basically,  if the script starts with
> 
> #!/usr/bin/perl
> 
> when I execute the script I get a "command not found" error message.  If the
> script starts with:
> 
> !#/usr/bin/perl -w
>the script runs as expected.  Any ideas?

This is very strange indeed. I get a shell error with this:
 ./try: !#/usr/bin/perl: not found

What shell do you use that accepts !# ??

A hint: "command not found" can mean that the interpreter cannot be
found. E.g. the path is incorrect.

> Also, trying to execute a chmod command from within a CGI script does not
> seem to do anything, but when run from a shell it executes correctly.
> 
> Very hard to track down these problems.  Thanks for any help.

Permission problems?
- Alex


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

Date: 29 Sep 1999 16:12:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: RedHat Linux 6.0 and Perl 5.005_03
Message-Id: <37f22c62_2@newsread3.dircon.co.uk>

news.way.com <mccomb@clubplanet.com> wrote:
> I have some very wierd behavior with some Perl scripts under a new Linux
> install.
> 
> Basically,  if the script starts with
> 
> #!/usr/bin/perl
> 
> when I execute the script I get a "command not found" error message.  If the
> script starts with:
> 
> !#/usr/bin/perl -w
> 
> the script runs as expected.  Any ideas?
> 

I dont believe you ...  the second isnt even a correctly formed shebang
line .

> 
> Also, trying to execute a chmod command from within a CGI script does not
> seem to do anything, but when run from a shell it executes correctly.
> 


This is  about permissions of the user the program runs as and is nothing
to do with Perl.


/J\
-- 
"I'm about to say a naughty word so if you're easily offended you can
fuck off now" - Daisy Donovan, The 11 O'Clock Show


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

Date: 29 Sep 1999 11:20:46 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Sorting weird numeric data
Message-Id: <x7u2odwxpt.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Unsigned chars? That's the *problem*. It's not Perl. Perl has
  A> scalars.  Unsigned chars is C. If I would want to code in C, I know
  A> where to get it.  I prefer coding in Perl.

but if you want speed, you have to go there. pack is not XS coding, but
perl accessing the machine layer for precise data control and speed. our
sort method takes advantage of that for its speed. if you don't care
about sort speed, stick with the ST and variants. i am not stopping
you. but for such an algorithmic person always quoting knuth, i would
think you would embrace the speed up over the higher level perl
code. larry showed a 3 time improvement over your sort and that will
grow with the size of the dataset. if you are crunching serious amounts
of data, you will come to love pack and our sort.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 29 Sep 1999 11:30:24 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Sorting weird numeric data
Message-Id: <x7ogelwx9r.fsf@home.sysarch.com>

>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:

  AS> Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc: [...]

  >> true, complex lists of pack fields can be confusing but this uses
  >> just C5 which is 5 unsigned chars. pretty easy to figure out. and
  >> it should be commented anyway. also i think there is a pack field
  >> comment syntax being worked on by ilya for 5.6 or beyond.

  AS> I've been thinking of a pack-string compiler -- the problem is of
  AS> course, how do you specify the data structure you want to
  AS> pack/unpack.  A somewhat extended/restricted (yes, both at a time)
  AS> C struct comes to mind, but then, how is that superior to bare
  AS> pack?

i have been working on a module which implements the GRP and it sorta
does that. it takes a list of sort key descriptions and generates the
code to extract them and pack them for sorting. it only uses the pack
fields that are needed for the sort to work which is a small subset of
all the descriptor.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 29 Sep 1999 16:09:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Using Net::Ping troubles
Message-Id: <37f22bc6_2@newsread3.dircon.co.uk>

Patrick Blalock <pblalock@orgtek.com> wrote:
> I was trying to write some utilities using Perl and the Net::Ping module.  I
> tried the example in Perldoc and in the Perl Cookbook:
>> more ping.pl
> #!/usr/bin/perl
> 
> use Net::Ping;
> 
> $host = "testbox";
> 
> $p = Net::Ping->new();
> print "$host is alive...\n" if $p->ping($host);
> $p->close;
> 
> When I run the script I get the following error:
> 
>> ping.pl
> Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at
> /usr/lib/perl5/5.00503/i386-linux/Socket.pm line 295.
> 
> I'm running Red Hat Linux 6.0 and Perl 5.005_03, does anyone know what the
> problem with this script is?
> 

There is no problem with the script (it works fine on several different
systems here.)  I have a suspicion it is because the installation of
Perl on Redhat 6.0 is broken in some way as we have several different
reports.  I would recommend that you get the source code for Perl and
compile it yourself rather than use the Redhat RPM.

/J\
-- 
"I was the chief make-up artist on the Titanic" - Tina Earnshaw, Chief
Make-Up Artist, Titanic


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

Date: 29 Sep 1999 16:17:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Using system() and directory name with white space
Message-Id: <37f22d75_2@newsread3.dircon.co.uk>

Susumu <Susumu.Sai@cognos.COM> wrote:
> My perl program:
> 
>     $dir = "ab\\cde fg\\hjk";
>     system ("mkdir $dir");
> 
> When I run the perl program in ActivePerl build 509 in Windows NT, I got an
> error message like:
> 
>     mkdir: directory “ab\cde”: can not find the path.
>     mkdir: directory “fg\hjk”: can not find the path.
> 
> I tried $dir = "ab\\\”cde fg\"\\hjk", but it doesn’t work too.
> 
> Does anyone know how to use the system() command and directory name with a
> white space.
> 

On the command line you would have to put quotes around the path if it has
spaces ... you should do here.  Alternatively you could use the
multiple argument form of system().

Infact Perl has a builtin mkdir() anyway so you dont need to use system at all.

/J\



-- 
"The Spice Girls don't care if I like them or not because I'm not twelve"
- Germaine Greer


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

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


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