[11885] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5485 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 26 12:16:58 1999

Date: Mon, 26 Apr 99 09:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 26 Apr 1999     Volume: 8 Number: 5485

Today's topics:
    Re: "learning perl" does not seem to be written well <hartleh1@westat.com>
    Re: "learning perl" does not seem to be written well <camerond@mail.uca.edu>
    Re: "learning perl" does not seem to be written well mikecard@my-dejanews.com
    Re: "learning perl" does not seem to be written well (Tad McClellan)
    Re: $ENV <aqumsieh@matrox.com>
    Re: cgi script (Juho Cederstrom)
    Re: cgi script <dgris@moiraine.dimensional.com>
    Re: DBI:ODBC - Problems adding, updating and deleteing  <admin@itology.com>
    Re: FAQ 3.26: Why don't perl one-liners work on my DOS/ (Chris Nandor)
    Re: Fork goddamit! Fork! ralawrence@my-dejanews.com
    Re: How do i print something using perl? (Larry Rosler)
        I LOVE YOU!!!! <sergue@ica.net>
    Re: I LOVE YOU!!!! <matt-news@sergeant.org>
        Is there Perl code to parse C++ programs? <matt'@'exotech.com>
    Re: Net::FTP creates Empty file (I R A Aggie)
    Re: newbie with a "howto" question (Chris Boyd)
        one script calling another <admin@itology.com>
        Problem Perl5.003_02 & BSDI3.1 kamez@my-dejanews.com
    Re: Problem Perl5.003_02 & BSDI3.1 <gellyfish@gellyfish.com>
        Problems in statically linking an extension to perl.lib atul_singh@my-dejanews.com
    Re: returning a hashtable from a subformula (Tad McClellan)
        rexec <rereidy@uswest.net>
    Re: rexec <gellyfish@gellyfish.com>
    Re: Statistics for comp.lang.perl.misc <tchrist@mox.perl.com>
    Re: STDOUT ?? <Tony.Curtis@vcpc.univie.ac.at>
    Re: Truncate doesn't work cryptoman@my-dejanews.com
    Re: Truncate doesn't work <gellyfish@gellyfish.com>
    Re: XBase and Perl2exe (Honza Pazdziora)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 26 Apr 1999 10:45:36 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <37247C10.D9BB2816@westat.com>

mikecard@my-dejanews.com wrote:

> i am only on page 13 and i am already getting aggrevated.  the book introduces
> the =~ operator in an example but never explains what it is (they just seem to
> assume you'll figure it out, but since this is supposedly a book for beginners
> NO assuptions should be made).

Well, they are going to have to make SOME assumptions.  For instance, they assume
you are an English speaker and don't bother translating into French, German or
Sanskrit.  As to your comment about the =~ operator, it is introduced on page 11,
is described as the "match operator" in a paragraph of text and used in a simple
code sample which illustrates its use.

> then they give an example for turning an inputed variable to lower case  with
> the expression  $name =~ s/\W.*//; the eplanation says this command is
> supposed to "zap" all the characters  in this expression and replace them
> with nothing...so, uhm if you take the contents of this scalar and replace
> them with nothing,  where does it go, ascii purgatory?  if the contents of
> this scalar are replaced with nothing how can you make the contents lower
> case (aren't you just making nothing lower case)

Let's read that paragraph again.  It says the expression $name =~ s/\W.*//; will
"take the contents of $name, find the first nonword character, and zap everything
from there to the end of the string."  That doesn't appear to be how you read it.
It does NOT convert anything from upper case to lower case and it does NOT zap the
entire string.  (By the way, I don't think it goes to ascii purgatory.  That
implies that it may get out one day.  I think it goes to eternal damnation.  I
could be wrong about that.)  The next expression ($name =~ tr/A-Z/a-z/;) takes
what is left (which is NOT nothing) and converts every upper case letter with the
equivalent lower case letter.  The phrase you missed is "everything from there to
the end of the string."

> i am very frustrated that i threw down my hard earned money  (which i have no
> problem doing if the product is as its advertised...in this case a BEGINNERS
> book on perl,  if this is a beginners book EVERYTHING should be explained and
> explained well).  and one last thing,  what the f*ck is SED AWK and GREP.  the
> book keeps making references to this and i do not have a clue what they are.

Neither did I when I used this book to learn Perl.  It doesn't really matter what
they are.  On page xxii under the "Other Books" section there is reference to a
book on the AWK Programming Language.  So, AWK is a programming language.  From
the preface to the book sed & awk (O'Reilly & Associates):

"Sed and awk are tools used by users, programmers, and system administrators -
anyone working with text files. Sed, so
called because it is a stream editor, is perfect for applying a series of edits to
a number of files. Awk, named after its
developers Aho, Weinberger, and Kernighan, is a programming language that permits
easy manipulation of structured
data and the generation of formatted reports."

> is there a perl book out there that is actually written for beginners.

You are going to have to read past page 13 if you expect all the pieces to fit
together.  Note that the section containing page 13 is titled "A Stroll Through
Perl."  That implies an overview, not a deep examination of each piece.  You will
get more information on the matching operator in chapter 7 (Regular Expressions).
Until then, you will have to just believe that they are not trying to confuse you
on purpose.  I found this book very readable and along with Programming Perl
(a.k.a. the camel book) quite complete.

> thanks for enduring my rant i feel much better

I'm glad.  Me too.

Henry Hartley





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

Date: Mon, 26 Apr 1999 09:53:40 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
To: mikecard@my-dejanews.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <37247DF4.D2EC73D6@mail.uca.edu>

[cc'd to mc]

mikecard@my-dejanews.com wrote:
> 
> hi
> 
> listening to suggestions from this group i purchased "learning perl" to...uhm
> learn perl (i was trying the various online tutorials but found they were
> making assumptions where they should not)
> 
> [details snipped]
> is there a perl book out there that is actually written for beginners.
> 
> thanks for enduring my rant i feel much better
> 
> mike cardeiro

Mike, from your headers, it appears that you are using Windows (98), and
therein lies your problem. If you have not had your book too long and
have not marked it up/burned it, you should go back down to the
bookstore and swap it for "Learning Perl on Win32 Systems," LP
re-written for those of us (myself included) who are Unix-deficient (the
last time I used "AWK" was when I was choking on some food caught in my
throat). This has the important info in the Llama for you, and is
written so non-computer-jocks (i.e., me again) can understand it with
only a little head scratching. 

Cameron

-- 
Cameron Dorey
camerond@mail.uca.edu


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

Date: Mon, 26 Apr 1999 15:07:09 GMT
From: mikecard@my-dejanews.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7g1vep$g5n$1@nnrp1.dejanews.com>

Randall

thank you for clearing that up for me.  I did not mean to badmouth your book
it's just that i have had so many problems over the years with learning
publications (usually manuals)  that make too many assumptions and basically
just do a poor job of explaining themselves.  i look forward to the next
chapters and hopefully will be ready to move on to "programming perl" before
long!

mike cardeiro



> Page 13 is still in chapter 1.  You are reading through the brief
> runthrough of everything that appears in later chapters.  It will be
> explained much more thoroughly later.
>
> Some people find the runthrough at "exactly the right overview" pace.
> If you're not, skip the rest of the runthrough, and go right to
> chapter 2.
>
> Perhaps I'll say it more explicitly in a future version of the
> book. :)
>
> print "Just another Perl [book] hacker,"
>
> --
> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger
merlyn@teleport.com)
> Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
> Quote: "I'm telling you, if I could have five lines in my .sig, I would!" --
me
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 26 Apr 1999 06:27:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <23f1g7.r23.ln@magna.metronet.com>

mikecard@my-dejanews.com wrote:

: since this is supposedly a book for beginners


   It is for beginning Perl programmers, but not for beginning programmers.


: NO assuptions should be made).


   You are being a little two absolute there.

   To comply I guess you would want

      "turn to the next page"

   at the bottom of each odd numbered page?

   :-)



: is there a perl book out there that is actually written for beginners.


   We cannot say because you have not said beginners at _what_.


   Perl?  (Learning Perl does that, IMO)

   Programming?   (There are a bunch. None (yet) that use Perl though)

   Programming in some particular environment (such as CGI)?

   ...??


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 26 Apr 1999 10:53:29 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: $ENV
Message-Id: <x3yhfq3cu1i.fsf@tigre.matrox.com>


"James Thurley" <jamesthurley@hotmail.com> writes:

> Where can I find info on the structure of the $ENV variable.

$ENV is just a regular variable, just like any other variable
$foo. Perhaps you mean the %ENV hash, which is a predefined variable?
You can find more info about it in perlvar.



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

Date: Mon, 26 Apr 1999 11:31:22 +0300
From: cederstrom@kolumbus.REMOVE_THIS.fi (Juho Cederstrom)
Subject: Re: cgi script
Message-Id: <slrn7i892q.11t.cederstrom@vortex.cede.net>

On Mon, 26 Apr 1999 10:16:13 +0200, 
Gil Zigelman <zgil@cs.technion.ac.il> wrote:
> In my script, I need to modify a file. The problem is that the script
> doesn't modify the file unless I give full writing permissions to the
> file, which is something I obviously to not want.

Check your server's configuration, and find out, who are the scripts
run as. In my system there's this kind of line in Apache's httpd.conf:

--- 8< ---
User nobody
--- 8< ---

So now you would say:

chown nobody /where/ever/is/the.file
chmod 0644 /where/ever/is/the/file

-- 
# This is a Perl-script which will display juhoc's email address
$_  = "ohuj s'ciameda lserdsi sdec tsreAmorlokTubmuTODsfi";
s/(.)(.)(.)(.)/$4$3$2$1/g;s/AT/\@/;s/DOT/\./;print $_."\n";




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

Date: 26 Apr 1999 08:56:04 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: cgi script
Message-Id: <m3iuaja0sb.fsf@moiraine.dimensional.com>

smnayeem@my-dejanews.com writes:

>   alainch <alain_chiorboli@email.sps.mot.com> wrote:
> > If you are under unix you can try to set the setgid bit for your cgi
> > script: chmod +s cgi_script_name

> how about if im using WinNT with ActivePerl?

You need to upgrade to a functional system.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Mon, 26 Apr 1999 15:06:21 GMT
From: David Cooper <admin@itology.com>
Subject: Re: DBI:ODBC - Problems adding, updating and deleteing records in MS  Access Database.
Message-Id: <37248278.8BF0582D@itology.com>

Hi Neil,

I'm in the same boat you are in switching an Access to MySQL, but having
found some major differences between the datastructures of MySQL and
Access, I'm not going to spend any time testing SQL calls to Access that
are later going to be used for MySQL. A quick look at your insert SQL
statement below looks like it should work, however with mySQL you leave
the auto-increment empty and it works, so try this instead:

$SQL ="INSERT INTO Test (number, radio) VALUES ('6','Foxtrot')";

number and radio are the field names. If this was for mySQL the ID field,
if it was an auto-increment, would automatically be put in.

Please let me know if this works. And since I have a similar project
coming up maybe we can share some other info.

cheers,

David

Neil Jedrzejewski wrote:

> Hi All,
>
> Due to a need to get our databases in running on non NT servers, I've
> been tasked with the job of re-writing our ASP as Perl to run on some
> Unix boxes.
>
> We're going to use MySQL in the end, but for now, I'm using DBI:ODB to
> interface with an existing MS Access database on my PC to test/debug.
>
> So far, everything is going find with searching the database, but I'm
> having problems with some more basic functions.
>
> My MS Access database has a primary key field called ID which is an
> auto-incrementing value for each record.
>
> The Update SQL statement seems to be working and using:
>
> $SQL = "UPDATE Test SET [Number] = 1, [Radio] = 'Alpha' WHERE [ID] =
> 1";
>
> works fine and will update records as needed.
>
> However, when I do and ADD statement with.
>
> $SQL = "INSERT INTO Test VALUES(0, '6', 'Foxtrot')";
>
> I hit a few snags. It works, but sets the ID field to 0 (as directed)
> but what I need is it to allow the database to automatically add the
> next available ID (auto-increment). Of course, executing the same
> command again, causes and error as it says ID 0 is already in use.
>
> Does anyone know how to do this or am I using the wrong SQL statment?
>
> Lastly, I'm lost as to what the SQL is I need to use to DELETE a
> value. Any pointers?
>
> Regards
>
> - Jed
>
> P.S. Please CC me replies via e-mail.

--
David Cooper, BA, CNA --- mailto:cooper@ITology.com
------------ http://www.itology.com --------------
------- Information Technology Developers --------




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

Date: Mon, 26 Apr 1999 10:00:45 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: FAQ 3.26: Why don't perl one-liners work on my DOS/Mac/VMS system?
Message-Id: <pudge-2604991000450001@192.168.0.77>

In article <Arved_37-2104990635290001@dyip-110.chebucto.ns.ca>,
Arved_37@chebucto.ns.ca (Arved Sandstrom) wrote:

# >     Under the Mac, it depends which environment you are using. The
# >     MacPerl shell, or MPW, is much like Unix shells in its support for
# >     several quoting variants, except that it makes free use of the
# >     Mac's non-ASCII characters as control characters.
# > 
# 
# You shouldn't ever have to use the MPW weird characters anywhere *except*
# exterior to the perl -e '...' statement proper; e.g. file specifications
# and what have you.

I thought you needed to use opt-d for the line continuation character,
even inside the perl -e '...'.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Mon, 26 Apr 1999 15:34:58 GMT
From: ralawrence@my-dejanews.com
Subject: Re: Fork goddamit! Fork!
Message-Id: <7g2133$hqq$1@nnrp1.dejanews.com>

In article <m13e1ntu2e.fsf@halfdome.holdit.com>,
  merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "ralawrence" == ralawrence  <ralawrence@my-dejanews.com> writes:
>
> ralawrence> I have some perl run as cgi which takes a whole load of params,
forks, the
> ralawrence> child displays a "thanks!" message whilst the parent goes off and
does
> ralawrence> something (which takes a while).
>
> The kid has to close STDOUT so that the web server knows that there's
> no one else around that might be talking to the web client (browser).
>

Here is a snippet of offending code that doesn't work:

---begin bad perl code---

#!/usr/bin/perl

print "Content-type: text/html\n\n";

if (!defined($child_pid = fork()))
{
  print "wow, an error\n";
  exit;
}

if ($child_pid)
{
  print "Wait 10 seconds and then look in the 'blah.txt' file ...\n";
  close(STDOUT);
  exit;
}

sleep(10);

open (BLAH, ">>/tmp/blah.txt" || die "erk!");
$t = time();
print BLAH "Seconds now are ... $t\n";
close (BLAH);

---end bad perl code---

When this runs despite the fact that STDOUT is closed, the code still waits
for the parent to finish. I've also tried running this through a UID and GID
wrapper and the same problems happen.

Am I not closing STDOUT correctly?

Rich

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 26 Apr 1999 07:50:24 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do i print something using perl?
Message-Id: <MPG.118e1cf68a0ba2b8989942@nntp.hpl.hp.com>

In article <7g1odh$989$1@nnrp1.dejanews.com> on Mon, 26 Apr 1999 
13:07:00 GMT, Tzadik Vanderhoof <tzadikv@my-dejanews.com> says...
 ... 
> If that doesn't work, try sending a form feed right before the "close"
> statement with:
> 
>    print PRINTER "\x0C";   # <-- That's a zero not an oh

     print PRINTER "\f";   # <-- That's Perl's representation of it

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


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

Date: Mon, 26 Apr 1999 11:41:34 -0700
From: serguei <sergue@ica.net>
Subject: I LOVE YOU!!!!
Message-Id: <3724B35D.713F67A9@ica.net>

Hi everybody

CGI.pm modul does not  support  the HTTP-EQUIL type of <META> tag
How can I modify the HTTP header directly with meta tag
<meta http-equiv="Content-Type content ="text/html;
charset=windows-1251">

My version is like this, but it does not work
print $query->header;
print $query->start_html(-title=>'Catalog page',
                                     -meta=>{'charset'=>'windows-1251',

'Content-Type'=>'text/html'});

Can somebody give me suggestion about it

Thanks  in advance

Serguei




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

Date: Mon, 26 Apr 1999 16:57:28 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: I LOVE YOU!!!!
Message-Id: <37248CE8.D89718AD@sergeant.org>

serguei wrote:
> 
> Hi everybody
> 
> CGI.pm modul does not  support  the HTTP-EQUIL type of <META> tag
> How can I modify the HTTP header directly with meta tag
> <meta http-equiv="Content-Type content ="text/html;
> charset=windows-1251">
> 
> My version is like this, but it does not work
> print $query->header;
> print $query->start_html(-title=>'Catalog page',
>                                      -meta=>{'charset'=>'windows-1251',
> 
> 'Content-Type'=>'text/html'});
> 
> Can somebody give me suggestion about it

First off, please don't use such ridiculous subject lines. We're
supposed to be perl proffesionals, and you're less likely to get help
that way.

Try:

print $query->header(-type => 'text/html; charset=windows-1251');

which does exactly what you want, and is safer/better than using a meta
tag.

-- 
<Matt email="msergeant@ndirect.co.uk" />

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: Mon, 26 Apr 1999 11:40:15 -0400
From: "Matthew Blais" <matt'@'exotech.com>
Subject: Is there Perl code to parse C++ programs?
Message-Id: <37248e62.0@newsfeed.vitts.com>

Is there Perl code available to parse C++ programs?  Or, where would I find
the C++ grammar to use with yacc?

Thanks,
-- Matt




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

Date: 26 Apr 1999 13:59:40 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Net::FTP creates Empty file
Message-Id: <slrn7i8sf9.7li.fl_aggie@stat.fsu.edu>

On Sun, 25 Apr 1999 18:40:24 +0100, Wayne Keenan
<tripix@tdi-net.freeserve.co.uk>, in <7fvkfb$vss$1@news6.svr.pol.co.uk> wrote:

+ Arrrg Im going sightly mad!

Well, I'm at wits end. What you have should work...

James - famous last words...


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

Date: 26 Apr 1999 14:15:34 GMT
From: chrisb@hgu.mrc.ac.uk (Chris Boyd)
Subject: Re: newbie with a "howto" question
Message-Id: <7g1se6$rbm$1@scotsman.ed.ac.uk>

Tad McClellan (tadmc@metronet.com) wrote:
: derose@my-dejanews.com wrote:

(snip)

: : I have two questions really
: : 1. Is there a comparable command or module to unix's uniq?  


:       perl -ne 'print unless $seen{$_}; $seen{$_}++' $file1  > $outfile

The above succeeds in removing all duplicated lines. But uniq(1) only
removes duplicate lines if they are adjacent. Compare:

tcsh% /bin/echo '1\n1\n2\n1' |\
 uniq
1
2
1
tcsh% /bin/echo '1\n1\n2\n1' |\
 perl -ne 'print unless $seen{$_}; $seen{$_}++'
1
2

To get a uniq(1) effect in a one-liner you can do (warily modifying
perlfaq4):

tcsh% /bin/echo '1\n1\n2\n1' |\
 perl -e '@in=<>;print grep($_ ne $prev && ($prev=$_), @in);'
1
2
1

No doubt there is a more optimal solution (NDTIAMOS).

Best wishes,
-- 
Chris Boyd                      | from (but not \  MRC Human Genetics Unit
Christopher.Boyd@hgu.mrc.ac.uk  | on behalf of) /      Crewe Rd, Edinburgh
http://www.hgu.mrc.ac.uk/Users/Christopher.Boyd          EH4 2XU, SCOTLAND


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

Date: Mon, 26 Apr 1999 14:45:17 GMT
From: David Cooper <admin@itology.com>
Subject: one script calling another
Message-Id: <37247D89.EF751E53@itology.com>

Howdy,

I have several perl scripts that use the same functions. Lets say these
functions are in login.pl and the script addevent.pl uses the same
functions but is on a different server, how do i get the addevent.pl to
call login.pl?

Thanks

--
David Cooper, BA, CNA --- mailto:cooper@ITology.com
------------ http://www.itology.com --------------
------- Information Technology Developers --------




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

Date: Mon, 26 Apr 1999 13:54:25 GMT
From: kamez@my-dejanews.com
Subject: Problem Perl5.003_02 & BSDI3.1
Message-Id: <7g1r6f$bt6$1@nnrp1.dejanews.com>

Hi guys,
i tried to run a script, that uses Net::Ping module, it doesn't work, since
each time it send the error message , that it can't locate the method "new"
for a class Net::Ping , here's the script followed by the error message :

/usr# perl5
#!/usr/bin/perl5
#create a PING Object, but using TCP instead of ICMP, that fakes
#the TCP connection used for any WEB Browsing....
my($ping_obj) = Net::Ping->new( );
if (! $ping_obj->ping('www.AAA.com'))
{
open(MAIL, "|mail XXXXXXXXXX.YYYYYYY\@ZZZZZZZZ.net");
print MAIL "Subject: UUU Access seems down, Please Check \n ";
close MAIL;

}
Can't locate object method "new" via package "Net::Ping" at - line 4.


If anyone has clue, i'll appreciate it ,
Thanks a lot for your Help.
Khalid.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 26 Apr 1999 15:47:45 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problem Perl5.003_02 & BSDI3.1
Message-Id: <37247c91@newsread3.dircon.co.uk>

kamez@my-dejanews.com wrote:
> Hi guys,
> i tried to run a script, that uses Net::Ping module, it doesn't work, since
> each time it send the error message , that it can't locate the method "new"
> for a class Net::Ping , here's the script followed by the error message :
> 
> /usr# perl5
> #!/usr/bin/perl5
> #create a PING Object, but using TCP instead of ICMP, that fakes
> #the TCP connection used for any WEB Browsing....
> my($ping_obj) = Net::Ping->new( );


If this is your actuakl code then you have forgotten to put

use Net::Ping

some where near the beginning.


/J\


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

Date: Mon, 26 Apr 1999 15:28:41 GMT
From: atul_singh@my-dejanews.com
Subject: Problems in statically linking an extension to perl.lib
Message-Id: <7g20n3$hcu$1@nnrp1.dejanews.com>

I want to statically link an extension to perl.lib , on windows NT
I used the Makefile.PL ( with LIBPERL_A => '..\..\perl.lib'
and LINKTYPE => 'static' ) to generate the makefile .
On doing nmake perl , this gives an error -:

 ....don't know how to make ....extralibs.ld

Can anyone among you give me some idea
a) How to statically link an extension to perl lib
or
b) Why this error is coming ?

Regards
Atul

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 26 Apr 1999 05:53:50 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: returning a hashtable from a subformula
Message-Id: <e3d1g7.pu2.ln@magna.metronet.com>

Kimberly Rice (kimrice@leland.Stanford.EDU) wrote:

: I am having problems returning a hashtable from a subfunction I made.  So,
                                                    ^^^^^^^^^^^
: the subfunction makes a hashtable with in it.  Call it %localHash.
: The main body call the subformula like this:
                         ^^^^^^^^^^


   Two different names for the same thing?

   With neither of them being what most folks call them?


   Text only communication is already severly hampered by lack of
   inflection, facial expressions, etc...

   Crippling it further with imprecise terms while discussing a
   technical subject is Not Good.


   They are called "subroutines" or "functions".



: %globalHash = FunctThatShouldReturnHT(arg);

: and FunctThatShouldReturnHT
: returns the table via the command:

: return %localHash;


   There are two lines of (pseudo) Perl code. Why not type in the
   other 10-12 lines that form a short and complete program that
   exhibits the behavior that you need help with?


 ------------------------------
#!/usr/bin/perl -w
use strict;

my %globalHash = FunctThatShouldReturnHT('arg');
foreach (sort keys %globalHash) {
   print "$_  ==>  $globalHash{$_}\n";
}

sub FunctThatShouldReturnHT {
   my($somearg) = @_;
   my %localHash;

   $localHash{$somearg} = 1;  # put something into the hash

   return %localHash;
}
 ------------------------------


: But, it is not working; there is no %globalHash after the subformula call.  


   Huh?

   That cannot be. The hash will exist, but it might contain 
   zero elements.

   I think maybe you meant that there are no keys in %globalHash?

   If you had shown us your real code we could help point out
   what you are doing wrong. 

   But you didn't, so we can't.


   Troubleshooting code that you cannot see is Very Hard...


: Can a subformula return a hash table?  


   Yes. Works for me.


: If so, what am I doing wrong?


   Not showing the broken code.


: Thanks, Kim (a 1st day perl programmer)


   Well then:

   1) always enable warnings to allow perl to help you find 
      common mistakes.

         #!/usr/bin/perl -w


   2) always do word searches in the standard Perl docs when you
      have a Perl question (about 1100 "pages" that come with
      perl. Find out where they are on your system)


   3) always enable warnings to allow perl to help you find 
      common mistakes.


   4) if that doesn't get the answer then do word searches of
      the Perl newsgroups at a Usenet archive such as:

         http://www.dejanews.com    (find Power Search)


   5) always enable warnings to allow perl to help you find 
      common mistakes.


   6) Use the "use strict;" pragma (compiler directive) and
      declare your variables with my() so that perl will help 
      you find yet more common mistakes.


   7) Always check the return value from System (not system()) calls
      such as open(), mkdir(), chmod(), etc...

      Include the $! special variable in the error message.

      Include some kind of delimiter character around filenames
      so you will be able to see whitespace(s) that have crept
      into the filename.

         open(FILE, $file) || die "could not open '$file'  $!";


   8) always enable warnings to allow perl to help you find 
      common mistakes.



   Good luck!


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Apr 1999 18:07:36 -0600
From: Ron Reidy <rereidy@uswest.net>
Subject: rexec
Message-Id: <3723AE48.79B12285@uswest.net>

This is a multi-part message in MIME format.
--------------62A5F0BDFF82F0D65BAB4E5C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I have a program (written in C) that opens a socket to another machin,
and runs a shell script n that machin.  The output from the remote
command is then capture on the local machine via a FIFO as input to
another local program.

Here is my question:  Is the C RTL function rexec() part of pedrl (i.e.
POSIX).  I cannot find any reference to it anywhere.

Thanks for your help.

rr

--------------62A5F0BDFF82F0D65BAB4E5C
Content-Type: text/x-vcard; charset=us-ascii;
 name="rereidy.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ron Reidy
Content-Disposition: attachment;
 filename="rereidy.vcf"

begin:vcard 
n:Reidy;Ron
x-mozilla-html:FALSE
org:Reidy Consulting, L.L.C.
version:2.1
email;internet:rereidy@uswest.net
title:Owner
x-mozilla-cpt:;0
fn:Ron Reidy
end:vcard

--------------62A5F0BDFF82F0D65BAB4E5C--



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

Date: 26 Apr 1999 15:41:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: rexec
Message-Id: <37247b0c@newsread3.dircon.co.uk>

Ron Reidy <rereidy@uswest.net> wrote:
> This is a multi-part message in MIME format.
> --------------62A5F0BDFF82F0D65BAB4E5C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 

Please try and work out how to stop your browser emitting this stuff
it is totally unecessary and will cause people to ignore your post
whatever its merits.

> 
> Here is my question:  Is the C RTL function rexec() part of pedrl (i.e.
> POSIX).  I cannot find any reference to it anywhere.
> 

It is not part of the standard Perl (although you could implement rexec
yourself I guess ) however you will be please to discover that there is a
Net::Rexec module available from CPAN

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: 26 Apr 1999 08:32:55 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <37247917@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Greg Bacon <gbacon@cs.uah.edu> writes:
:
:Top 10 Threads by Number of Posts
:=================================
:
:Posts  Subject
:-----  -------
:
:   25  Top 10 newbie errors?
:   19  newbie with a "howto" question
:   18  CGI programmer wanted
:   18  last item in associative array.
:   17  Is there a shorter way?
:   17  How to make an array name to be a variable?
:   16  Unix files in MacPerl
:   16  The Future of Tk?
:   16  Generating a unique string for order number
:   14  Verifying text in a string

I'm so very happy that I kill on the muffyword "newbie"
in the subject line.  Perhaps it's time to repost my
killfile to help others avoid the crap as well.

--tom
-- 
"Ah! Don't say that you agree with me. When people agree with me I always feel 
 that I must be wrong."
				- Oscar Wilde


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

Date: 26 Apr 1999 17:30:27 +0200
From: Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
Subject: Re: STDOUT ??
Message-Id: <83676jwga4.fsf@vcpc.univie.ac.at>

Re: STDOUT ??, Jimx <jimx@metronet.com> said:

Jimx> how do i print a location command after a
Jimx> content-type?  print
Jimx> "Content-type:text/html\n\n"; print "some text
Jimx> and html"; print "Location: $file_name\n\n";

That isn't meaningful.  Once the Content-Type header
goes out, you're then in the body of the document
being returned to the browser, or whatever.  So your
Location gets rendered here as HTML.

The Location belongs to the headers; the
double-newline after the Content-Type ends the
headers.

You don't need the Content-Type, just the redirect
Location.  The type of the redirect isn't known (in
the general case) to you.

hth
tony


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

Date: Mon, 26 Apr 1999 15:06:38 GMT
From: cryptoman@my-dejanews.com
Subject: Re: Truncate doesn't work
Message-Id: <7g1vdq$g5d$1@nnrp1.dejanews.com>



> What do you mean "next line of the line deleted"? truncate() doesn't delete
> "a line".  Everything after byte $LineAddr is *gone*.

Thank you for the advice. Do you know a function that deletes a line in a
text's file?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 26 Apr 1999 16:48:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Truncate doesn't work
Message-Id: <37248ab6@newsread3.dircon.co.uk>

cryptoman@my-dejanews.com wrote:
> 
> 
>> What do you mean "next line of the line deleted"? truncate() doesn't delete
>> "a line".  Everything after byte $LineAddr is *gone*.
> 
> Thank you for the advice. Do you know a function that deletes a line in a
> text's file?
> 

There isnt one.  You need to read the section in the perlfaq5 entitled:

  How do I change one line in a file/delete a line in a file/insert a line 
  in the middle of a file/append to the beginning of a file? 

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Sun, 25 Apr 1999 10:14:50 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: XBase and Perl2exe
Message-Id: <slrn7i5qop.1pu.adelton@aisa.fi.muni.cz>

On Sat, 24 Apr 1999 13:15:26 +0200, Deserranno Mario <mario_deserranno@hotmail.com> wrote:
> Has anyone ever tried to convert his *.pl who also uses the XBase module
> (reading dbf.databases) to exe's with the help of Perl2exe???

Yes, there is at least one guy who did it (and shared his experiance).
No problem except for XBase loading some rarely used modules on the
fly using require (grep require `find . -name '*.pm' -print` to find
them) that you have to either use them in advance if you want to run
them later, or do something similar. No big deal.

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
 make vmlinux.exe			-- SGI Visual Workstation Howto
Any spam sent to my email will be rewarded by complaint to your ISP abuse
  team and abuse teams of servers that relayed that message. It works.


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

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

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

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5485
**************************************

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