[16253] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3665 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 14 09:05:23 2000

Date: Fri, 14 Jul 2000 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)
Message-Id: <963579910-v9-i3665@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 14 Jul 2000     Volume: 9 Number: 3665

Today's topics:
    Re: Advanced Regexp Parsing HELP! Please <bart.lateur@skynet.be>
        Another newbie seeks help and assistance... (Paul Linehan)
    Re: Escaping strings. <taboo@doofa.net>
        Getting a host's local ip addresses <Christoph.Vogel@Corbach.de>
    Re: how to convert "1.2.3.10" to "01020310"? (Keith Calvert Ivey)
        I want to use ? in CGI! <arild@langtind.no>
        Newbie Globbing Question <MarkOn******@ukgateway.net>
        Newbie: Reading in file contents (Tony Balazs)
    Re: Newbie: Reading in file contents <mcnultya@nortelnetworks.com>
    Re: Newbie: Reading in file contents (Bernard El-Hagin)
    Re: Newbie: Reading in file contents (Bernard El-Hagin)
    Re: Newbie: Reading in file contents <bcaligari@shipreg.com>
        Perl - BUG? <nivel33@hotmail.com>
    Re: Perl - BUG? (Bernard El-Hagin)
        Perl Expert? I need help! <sylvain2k@sympatico.ca>
        Perl on irc <taboo@doofa.net>
    Re: Perl Rocks!(OT?) <Joe.Rocklin@sdrc.com>
        Pushing referenced objects on an array <mcnultya@nortelnetworks.com>
    Re: Random number between 1 and x <raphaelp@nr1webresource.com>
    Re: searching multiple sites <LByesly@onebox.com>
    Re: The newbie question (Jon Bell)
        untainting insecure dependancy? pkey@sghms.ac.uk
    Re: Using ASP objects with Perl modules <samara_biz@hotmail.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 14 Jul 2000 13:00:41 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Advanced Regexp Parsing HELP! Please
Message-Id: <gistmsclhgg53ph9975hnnu1jv1banpi41@4ax.com>

Nathan Wiger wrote:

>I'm working on a project which has to parse an Apache-like configuration
>file. The file it needs to parse will have lines that look like this:
>
>   SomeVariable     /path/name
>   SomeArray        index.html index.shtml index.cgi
>   SomeScalar       "with spaces in it"
>   SomethingTough   mixed array "where some" have "spaces " 

That sounds like an ordinary "CSV" file, with the comma's replaced by
spaces. So, I'd expect that the Text::CSV (or Text::CSV_CS) files can be
used.

Otherwise, for simpleminded parsing, use:

	@all = /"[^"]*"|\S+/g;

That's won't strip the quotes off parameters, but you can do that in a
later step.

	foreach (@all) { s/^"// and s/"$//; }

-- 
	Bart.


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

Date: Fri, 14 Jul 2000 10:34:45 GMT
From: paul.linehan@datalex.ie (Paul Linehan)
Subject: Another newbie seeks help and assistance...
Message-Id: <396eecc1.1703970@news.esat.net>

	

Hello all,


the title explains my situation - I've just started a new job (was a
Delphi programmer - may get back there some day after it goes to
Linux/FreeBSD) and we have a few Unix boxes lying around here and
I want to use some perl on them.


Since universities these days don't teach Unix anymore (I am
appalled at the number of so-called computer science "graduates"
who don't know what "ls" or "pwd" are...aw well...)


I have basically *_nobody_* to ask + plus I'm doing this off my own
bat so to speak - I do have the Learning Perl book, but I feel that I
need to have my hand held at the very beginning at least.


Anyway, I want to write some perl scripts to automate some tasks which

we have to do on a HP UX ver. 11 box (it's easy at first, but bear
with me, it gets a wee bit trickier later on)

open a terminal window - this could be done manually, but hey, if perl
can be used so much the better...

from directory

/opt/vnc // we run vnc so that we can access the machine using a 
windows
(boo) box.

cd .. // up a level

cd Ho*r // This changes to /opt/HostAccessServer - the * is a HP thing
to resolve
// unambigious names AFAIK.

cd lookup // down another level

 ../web.sh& // start this process
 ../rmidaemon & // start another... 8-)

cd .. // ups a daisy.

// this is where it gets tricky.

 ../runhas > runhas.log // start "has" and feed output to runhas.log

Then this terminal window is minimised and a new one is opened, again 
we
are in /opt/vnc

cd ..
cd Ho*r

tail -f runhas.log // Leave this window open - basically we want to
perform
// different tasks with "has" and look at
the output and return
// data, as we are performing the tasks

Then open another window,

cd ..
cd J*0 (JavaWebServer2.0)

cd bin

 ../startup // and leave this window open as well.

And that's it. The tail -f runhas.log window is the most important and
can be started after the JavaWebServer if necessary for keeping it on
top of the other window.


Any help/ideas/questions/donations gratefully appreciated.


Paul...




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

Date: 14 Jul 2000 10:51:48 +1000
From: "Kiel Stirling " <taboo@doofa.net>
Subject: Re: Escaping strings.
Message-Id: <396e6424$1_3@nexus.comcen.com.au>


chuckw <chuckwNOchSPAM@silverlink.net.invalid> wrote:
>The answer to this is not obvious to me or perhaps I have simply
>been up too late. In a nutshell, I have some text in a scalar
>that was submitted from a webpage for example. I then submit that
>text to a database. (for the sake of argument, we'll assume the
>input is secure) Whenever the inputted text has a quote or
>something like that, it fouls up the code that inputs it into the
>database. No big deal, I just use an RE to escape all of the
>errant characters. Unfortunately the escape characters go along
>with the text into the database. The problem arises when other
>applications (that I have no control over) access the data. All
>of the escaped characters have to be un-escaped or else the
>slashes make it into the output.
>
>My question: How do I accept input with these characters (", ', `
>etc) without escaping them? Is there a way to render the string
>"inert" so that when it is evaluated in my SQL statement, the
>errant characters don't clog the works???
>
>
>-----------------------------------------------------------
>
>Got questions?  Get answers over the phone at Keen.com.
>Up to 100 minutes free!
>http://www.keen.com
>



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

Date: Fri, 14 Jul 2000 13:50:38 +0200
From: "Christoph Vogel" <Christoph.Vogel@Corbach.de>
Subject: Getting a host's local ip addresses
Message-Id: <8kmuqv$met$15$1@news.t-online.com>


Hash: SHA1

Does someone know about a way to get an array of local ip addresses
(e.g. eth, ppp, slip) without processing the output of unix/linux'
ifconfig?

Thanks in advance,

Christoph.


Version: PGP 6.5.3

iQA/AwUBOW7wfmvumZdjbAkeEQLmQwCg1HvG4VarUgDPn7c9KTZ8znfO3z4AoOAd
JJkCfSZoNSc5z+Ok4ICM1XuQ
=2M4d
-----END PGP SIGNATURE-----





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

Date: Fri, 14 Jul 2000 12:57:22 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <396f0dd2.36315076@nntp.idsonline.com>

cberry@cinenet.net (Craig Berry) wrote:
>ethan (woowk@my-deja.com) wrote:

>: Do I have to use regression expression?
>
>That's "regular expression", often abbreviated as "regex".  And you don't
>have to.  Here's how I'd do it:
>
>  $oldForm = '2.1.3.14';
>  $newForm = join '', map { sprintf '%02d', $_ } split /\./, $oldForm;

Well, you may not have to use a regex (you could do something
with index(), for example), but your solution did use one (as
mine would have), right after the word "split".

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Fri, 14 Jul 2000 11:57:23 GMT
From: "langtind" <arild@langtind.no>
Subject: I want to use ? in CGI!
Message-Id: <DeDb5.2837$Dxe.185839104@news.telia.no>

How do I make a cgi-script that understand script.cgi?something
I have made to make: script.cgi something by using ARGV[0)

Trond Aage




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

Date: Fri, 14 Jul 2000 11:14:21 +0100
From: "Mark Fletcher" <MarkOn******@ukgateway.net>
Subject: Newbie Globbing Question
Message-Id: <8kmpdq$a53$1@lure.pipex.net>

Hi,

Please find enclosed a script that I wrote that attempts to use globbing.
Unfortunately I am having problems with it. The purpose of the script is to
copy logfiles to a certain location and then cat logfiles of a similar type

The files have a naming format like:

log.processname.0714.05

Where 0714 is the date in mm/dd 05 is the hour that the log is created.

I have two issues with my script.

1) Id like to copy logs ending in .01 to .23, while the glob statement I
have works, is there any way of simplifying it?
2) Id like to cat logs of a the same process into one big file. The cat
statement I have doesnt produce the desired effects. How do I fix it?

Ive consulted the usual sources (Learning Perl, Perl Cookbook, Programming
Perl) but to no avail ;-(

Any help would be greatly appreciated!

Thanks,

Mark

#!/usr/bin/perl -w

$yest  = 712;
$today  = 713;
$yestlog = '$_$yest';
$todylog = '$_$today';

@logs   = qw(log.lotinq.0);
         # log.pfc.u.0 );

while ( defined ( $filename = glob( "/home/mark/testglob/*" ) ) ) {
   $filename  =~ s#.*/##;
   print "I found the file $filename \n";
}
print "$yest $today \n";

foreach $_ (@logs) {
    while ( defined ( $filename =
    ### Can this glob statement be tidied up?
    <./$_$yest.0[1-9]* ./$_$yest.1[2-8]* ./$_$yest.2[0-3]* ./$_$today.00>
    ) ) {
        system("cp $filename \/home\/mark");
        ### How do I get the cat statement to work properly?
        system("cat $filename > log");
        $filename =~ s#.*/##;
        print "I found the file $filename \n";
    }
}









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

Date: Fri, 14 Jul 2000 12:30:15 GMT
From: tbalazs-this-must-go@netcomuk.co.uk (Tony Balazs)
Subject: Newbie: Reading in file contents
Message-Id: <396f069c.643571@1.0.0.119>

In my test program I have;

#!/usr/bin/perl
open (JOBS, "/usr/local/www/dats/jobs.dat");
$jobs = <JOBS>;
print $jobs;
print "\n";
close (JOBS);

This prints the first line of jobs.dat only.
How can I have all the lines printed, one under the other?

Thanks,

Tony.


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

Date: Fri, 14 Jul 2000 13:39:03 +0100
From: Antony <mcnultya@nortelnetworks.com>
Subject: Re: Newbie: Reading in file contents
Message-Id: <MPG.13d91a4210b9b33e989694@eurnews0>

Tony Balazs said...
> $jobs = <JOBS>;

replace that line with:

@jobs = <JOBS>;

> print $jobs;
> print "\n";

replace those two lines with:

print join("\n", @jobs);

> Thanks,
> 
> Tony.
> 

No probs,

Antony


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

Date: Fri, 14 Jul 2000 12:53:28 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Newbie: Reading in file contents
Message-Id: <slrn8mu31n.9rf.bernard.el-hagin@gdndev25.lido-tech>

Tony Balazs <tbalazs-this-must-go@netcomuk.co.uk> wrote:
>In my test program I have;
>
>#!/usr/bin/perl
>open (JOBS, "/usr/local/www/dats/jobs.dat");
>$jobs = <JOBS>;

The interpreter doesn't know that you want to do this more than once.

>print $jobs;
>print "\n";
>close (JOBS);

You have to read the file in a loop to get all the lines. Try this:

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

open (JOBS, "< /blah/blah/jobs.dat") or die "Can't open jobs.dat: $!";

while (my $jobs = <JOBS>){
	print $jobs;
}
close (JOBS);
_________________

The first two lines should start all of your Perl programs and you
should always check the result of open as I did above.

Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#


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

Date: Fri, 14 Jul 2000 13:01:42 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Newbie: Reading in file contents
Message-Id: <slrn8mu3h4.9rf.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 14 Jul 2000 13:39:03 +0100, Antony <mcnultya@nortelnetworks.com> wrote:
>Tony Balazs said...
>> $jobs = <JOBS>;
>
>replace that line with:
>
>@jobs = <JOBS>;

Note that this puts the entire file in memory. If the file is too
large you may not want to do this.

Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#


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

Date: Fri, 14 Jul 2000 15:06:07 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: Re: Newbie: Reading in file contents
Message-Id: <8kn2kj$bhl$1@news.news-service.com>

"Tony Balazs" <tbalazs-this-must-go@netcomuk.co.uk> wrote in message
news:396f069c.643571@1.0.0.119...
> In my test program I have;
>
> #!/usr/bin/perl
> open (JOBS, "/usr/local/www/dats/jobs.dat");
> $jobs = <JOBS>;
> print $jobs;
> print "\n";
> close (JOBS);
>
> This prints the first line of jobs.dat only.
> How can I have all the lines printed, one under the other?
>
> Thanks,
>
> Tony.

umm....if to output all the lines of a file to standard output
just type "cat /usr/local/www/dats/job.dat at the shell" prompt

for perl, use the -w parameter and 'use strict'
Your main peroblem is that you are reading only
the first line of JOBS.
try using @jobs instead of $jobs

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

my(
 $jobs, # scalar
 @jobs, # list
);

print("doing it in the scalar way\n");
open(JOBS, 'jobs.dat');
while ($jobs = <JOBS>) {
 print($jobs);
}
close(JOBS);

print("\n");

print("doing it in the list way\n");
open(JOBS, 'jobs.dat');
@jobs = <JOBS>;
print(@jobs);
close(JOBS);

exit(0);









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

Date: Fri, 14 Jul 2000 14:07:13 +0200
From: "Nivel33" <nivel33@hotmail.com>
Subject: Perl - BUG?
Message-Id: <8kmvp3$1a7$1@diana.bcn.ttd.net>

Somebody can see the mistake?

The result in screen is ok, but the IMPORTANT is the calculation.
In perl 4.1 - 4 = 0.9999999996 (4.1, 5.1, 6.1, etc, etc)  num.1 - num != 0.1

#!/usr/local/bin/perl
local $nValor;
$nValor = 4.1 - 4;
print "With 'print'  4.1 - 4 = $nValor \n";
printf "With 'printf' 4.1 - 4 = %.1f \n", $nValor;
print "IS NOT EQUAL ! 4.1 - 4 no es igual a 0.1 \n" if ($nValor != 0.1 );


Sorry my english
Nivel 33



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

Date: Fri, 14 Jul 2000 12:17:44 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl - BUG?
Message-Id: <slrn8mu0um.9rf.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 14 Jul 2000 14:07:13 +0200, Nivel33 <nivel33@hotmail.com> wrote:
>Somebody can see the mistake?
>
>The result in screen is ok, but the IMPORTANT is the calculation.
>In perl 4.1 - 4 = 0.9999999996 (4.1, 5.1, 6.1, etc, etc)  num.1 - num != 0.1

perldoc perlfaq4

Read the first question (and answer, of course :-)

Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#


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

Date: Fri, 14 Jul 2000 13:02:42 GMT
From: "Sylvain2k" <sylvain2k@sympatico.ca>
Subject: Perl Expert? I need help!
Message-Id: <SbEb5.72757$W35.1815869@news20.bellglobal.com>

(sorry... I'm a french canadian so my english is bad)

Hi,

I have a little problem. there it is:

$a = "My name is Sylvain";

I want to delete ALL spaces in this variable.
I only want the first 8 caracters of the result.

How can I do that?

Thanks a lot!






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

Date: 14 Jul 2000 04:50:53 +1000
From: "Kiel Stirling " <taboo@doofa.net>
Subject: Perl on irc
Message-Id: <396e0f8d_3@nexus.comcen.com.au>


Any idea's on good perl irc channels?

Kiel Stirling 


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

Date: Fri, 14 Jul 2000 08:01:49 -0400
From: Joe Rocklin <Joe.Rocklin@sdrc.com>
Subject: Re: Perl Rocks!(OT?)
Message-Id: <396F012D.2438B4A3@sdrc.com>

This is a multi-part message in MIME format.
--------------7C55C19C98B57125CBD491F0
Content-Type: multipart/alternative;
 boundary="------------BABD5ACBEA919834E853992A"


--------------BABD5ACBEA919834E853992A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi there,
    Let me start by saying that I am in no way a full-time professional.  I'm
starting college in the fall, but I've been working at a company for the past
two summers, mostly full time, doing web programming - solely in perl.  For my
applications, a good knowledge base of UNIX is needed to act with the server
and dish out the information required.  More recently, I have been working with
MySQL, which took some getting used to, and I'll admit I'm still learning about
it.  But I completely agree that perl ROCKS!!!

    As far as a different logic, learn regular expressions if you don't
already.  They make parsing input, and filenames, and basically any string so
much easier.  And perl is one of the best languages for using rexep's there
is.  (A good book for learning them is 'Mastering Regular Expressions' from
O'Reilly, isbn-1565922573, and I think bookpool.com might still be running a
special on all their O'Reilly books, just FYI).

I hope some of this answered some of your questions.  Enjoy perling!

--Joe

Rage Matrix wrote:

> I don't know if this is off-topic for this NG, but I'm gonna say my thing
> anyways. I have just started my new job at a local software company. I have
> just graduated from university and didn't know anything about Perl at all. I
> have, however, used Linux a fair bit and also had knowledge of C++, Java and
> VB. This was my first interview and I got the job even though I made it
> clear that I knew nothing about Perl. Working is MUCH better than
> university. I get to code all day and I actually get paid for it. Its like
> getting paid for your hobby. Awesome!
>
> Anyway, I have come to the conclusion that Perl ROCKS! I don't see much
> point in using it on a non-UNIX based machine, but the language integrated
> so well with Linux and I LOVE it! I always considered UNIX OS's to be less
> of a technology and more of an art form and Perl simply makes this art form
> a richer experience.
> I just wanted to tell the world that!
> BTW, as I have never posted to this NG before, as I have only been working
> at my first full-time job for two weeks, how many programmers here work
> solely with Perl and do most of you use it primarily on UNIX/Linux systems
> or Win32? How long did you code in Perl before you became quite proficent in
> it? What are the job prospects of Perl programmers generally?
> How important is in-depth knowledge of  UNIX regarding your proficieny in
> Perl?
> (Sorry for all the questions, but...) Is the mindset for Perl different from
> OO languages like C++ and Java? i.e. Is there a different logic that helps
> you solve Perl problems faster?
> The motto that I have learnt so far is: Never assume anything. (This is
> regarding bugs in Perl programs).
>
> Sorry for the rant, but I'm very happy with working with Perl!!
>
> Regards,
>
> Jon.
> BSc Computer Studies (Graduate! Wow, that's gonna take some getting used
> to!)
>
> --
> Jonathan M Baker
> Software Engineer, Semantico Ltd (www.semantico.com)
> Tron Software: http://www.tronsoftware.freewire.co.uk
> -=The views expressed by me are not necessarily those of Semantico=-

--
------------------------------------------------------------------------------
Joe Rocklin             joe.rocklin@sdrc.com
"The whole of science is nothing more than a refinement of everyday thinking."
        -- Albert Einstein, Physics and Reality [1936]:



--------------BABD5ACBEA919834E853992A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi there,
<br>&nbsp;&nbsp;&nbsp; Let me start by saying that I am in no way a full-time
professional.&nbsp; I'm starting college in the fall, but I've been working
at a company for the past two summers, mostly full time, doing web programming
- solely in perl.&nbsp; For my applications, a good knowledge base of UNIX
is needed to act with the server and dish out the information required.&nbsp;
More recently, I have been working with MySQL, which took some getting
used to, and I'll admit I'm still learning about it.&nbsp; But I completely
agree that perl ROCKS!!!
<p>&nbsp;&nbsp;&nbsp; As far as a different logic, learn regular expressions
if you don't already.&nbsp; They make parsing input, and filenames, and
basically any string so much easier.&nbsp; And perl is one of the best
languages for using rexep's there is.&nbsp; (A good book for learning them
is 'Mastering Regular Expressions' from O'Reilly, isbn-1565922573, and
I think bookpool.com might still be running a special on all their O'Reilly
books, just FYI).
<p>I hope some of this answered some of your questions.&nbsp; Enjoy perling!
<p>--Joe
<p>Rage Matrix wrote:
<blockquote TYPE=CITE>I don't know if this is off-topic for this NG, but
I'm gonna say my thing
<br>anyways. I have just started my new job at a local software company.
I have
<br>just graduated from university and didn't know anything about Perl
at all. I
<br>have, however, used Linux a fair bit and also had knowledge of C++,
Java and
<br>VB. This was my first interview and I got the job even though I made
it
<br>clear that I knew nothing about Perl. Working is MUCH better than
<br>university. I get to code all day and I actually get paid for it. Its
like
<br>getting paid for your hobby. Awesome!
<p>Anyway, I have come to the conclusion that Perl ROCKS! I don't see much
<br>point in using it on a non-UNIX based machine, but the language integrated
<br>so well with Linux and I LOVE it! I always considered UNIX OS's to
be less
<br>of a technology and more of an art form and Perl simply makes this
art form
<br>a richer experience.
<br>I just wanted to tell the world that!
<br>BTW, as I have never posted to this NG before, as I have only been
working
<br>at my first full-time job for two weeks, how many programmers here
work
<br>solely with Perl and do most of you use it primarily on UNIX/Linux
systems
<br>or Win32? How long did you code in Perl before you became quite proficent
in
<br>it? What are the job prospects of Perl programmers generally?
<br>How important is in-depth knowledge of&nbsp; UNIX regarding your proficieny
in
<br>Perl?
<br>(Sorry for all the questions, but...) Is the mindset for Perl different
from
<br>OO languages like C++ and Java? i.e. Is there a different logic that
helps
<br>you solve Perl problems faster?
<br>The motto that I have learnt so far is: Never assume anything. (This
is
<br>regarding bugs in Perl programs).
<p>Sorry for the rant, but I'm very happy with working with Perl!!
<p>Regards,
<p>Jon.
<br>BSc Computer Studies (Graduate! Wow, that's gonna take some getting
used
<br>to!)
<p>--
<br>Jonathan M Baker
<br>Software Engineer, Semantico Ltd (www.semantico.com)
<br>Tron Software: <a href="http://www.tronsoftware.freewire.co.uk">http://www.tronsoftware.freewire.co.uk</a>
<br>-=The views expressed by me are not necessarily those of Semantico=-</blockquote>

<pre>--&nbsp;
------------------------------------------------------------------------------
Joe Rocklin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; joe.rocklin@sdrc.com
"The whole of science is nothing more than a refinement of everyday thinking."&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Albert Einstein, Physics and Reality [1936]:</pre>
&nbsp;</html>

--------------BABD5ACBEA919834E853992A--

--------------7C55C19C98B57125CBD491F0
Content-Type: text/x-vcard; charset=us-ascii;
 name="Joe.Rocklin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joe Rocklin
Content-Disposition: attachment;
 filename="Joe.Rocklin.vcf"

begin:vcard 
n:Rocklin;Joe
tel;work:513-576-7614
x-mozilla-html:TRUE
org:SDRC
adr:;;;Milford;OH;45150;USA
version:2.1
email;internet:Joe.Rocklin@sdrc.com
x-mozilla-cpt:;-27392
fn:Joe Rocklin
end:vcard

--------------7C55C19C98B57125CBD491F0--



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

Date: Fri, 14 Jul 2000 11:54:17 +0100
From: Antony <mcnultya@nortelnetworks.com>
Subject: Pushing referenced objects on an array
Message-Id: <MPG.13d901b0695efcfc989691@eurnews0>

Hi there,

I'm terrible at explaining this stuff, but see if you get what I mean:

while (<file>) {
	chomp;
	@temp = split(/[, ]/, $_);

	my $human = spawn Person;
	$human->cname($temp[1]);
	$human->sname($temp[2]);
	$human->fullname($human->cname . " " . $human->sname);
	$human->dept($temp[3]);

	$array[$count] = \$human;
	$count++;
}

for(@array) {
	... do stuff ...
}

The above code works fine, and gives me just what I need.
BUT... why wont it work when I replace:

	$array[$count] = \$human;

with
	push(@array, \$human);

It returns an error of "Not a SCALAR reference at ..."

Can anyone explain why it is like this please ?

Cheers,

Antony


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

Date: Fri, 14 Jul 2000 13:49:24 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Random number between 1 and x
Message-Id: <8kmv1c$1kt$12$1@news.t-online.com>

thanks!

Craig Berry <cberry@cinenet.net> wrote in message
news:smscask3nd669@corp.supernews.com...
> Raphael Pirker (raphaelp@nr1webresource.com) wrote:
> : just got the answer:
> :
> : use POSIX;
> : $random = rand(10);
> : $random = ceil($random);
>
> Not quite.  This has a vanishingly small but nonetheless real chance of
> generating 0 in addition to 1..10.  You want
>
>   $random = 1 + int rand(10);
>
> (for generating integers 1-10.)
>
> --
>    |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
>  --*--  "Beauty and strength, leaping laughter and delicious
>    |   languor, force and fire, are of us." - Liber AL II:20




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

Date: Fri, 14 Jul 2000 11:27:58 GMT
From: Jack <LByesly@onebox.com>
Subject: Re: searching multiple sites
Message-Id: <396EF946.14931A32@onebox.com>

Nitin wrote:
> 
> Hi,
> 
> I'm trying to write a script that will allow a user to enter a search
> term and have it searched over multiple web sites. The problem I am
> running into is that some of these sites that I am searching are
> password protected. I have access to the sites and I know how to deal
> with sites that are using the standard web server authentication (where
> the browser pops up the the userid/password challenge box). How do I
> deal with sites that have set up their own authentication mechanism
> (via a custom logon page) like the one at
> http://www.nytimes.com/auth/login
> 
> Any input is appreciated.
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

================================
I assume you are using libwww  ?

if so you must have  HTML::Form
look in Form.pm  --> do (~/$ pod2html --infile Form.pm --outfile...)

look at $form->click([$name],[x$,$y])  that ought to work if it's click
to logon
or
        $form->value($name,[$value])  if you just need to send a name
and pword.

I'm just a newbee but you said anything was appreciated..
- jack


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

Date: Fri, 14 Jul 2000 12:11:25 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: The newbie question
Message-Id: <FxosJ1.HAs@presby.edu>

In article <8F7126962newsid7759367@216.65.3.131>,
HiTekHick <HiTekHick@hillbilly.com> wrote:
>
>My question is, (when relevant) should I attempt a lame reply that may 
>have mistakes unbeknownst to myself,

A good way to guard against this is to test your code before you post it.  
As you gain experience you might be able to get away most of the time with
not testing really simple stuff, but take it from me, you'll get burned
occasionally if you do that.

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
[ Questions about newsgroups?  Visit http://www.geocities.com/nnqweb/  ]
[                or ask in news:news.newusers.questions                ]


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

Date: Fri, 14 Jul 2000 10:23:48 GMT
From: pkey@sghms.ac.uk
Subject: untainting insecure dependancy?
Message-Id: <396ee8e5.7888928@news.sghms.ac.uk>

Solaris

I have a perl program which I pass a parameter using @ARGV.

The program runs something like this:

$test_user = $ARGV[0];

$quota1 = `quota -v $test_user`;

I then get the following taint error:

Insecure dependency in `` while running with -T switch (referring to
the quota system call.  

I know why I'm getting the taint error - how can I untaint the error
so that my program runs?

Thanks for your help.

Paul


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

Date: Fri, 14 Jul 2000 08:17:57 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: Using ASP objects with Perl modules
Message-Id: <396F04F5.DF06850@hotmail.com>

No, in fact I think it doesn't matter, but it's usually written with
capital letter first.

My question is how to export ASP objects in a module, so that functions
in the module could use them?
(see the original posting)

Alex

jason wrote:

> Alex T. wrote ..
> > $Response->Write("<h3>".$to_print."</h3>");
>
> I'm no expert on PerlScript at all (never used it) - but isn't that
> meant to be $Response->write() ?? .. ie. lowercase 'w'
>
> --
>   jason -- elephant@squirrelgroup.com --



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

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


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