Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-16 Thread dolphin_sonar
On Jan 15, 7:39 am, telemac...@arpinum.org (Telemachus) wrote:
 On Wed Jan 14 2009 @  8:17, dolphin_sonar wrote:



  Hi,

  I bought the O'Reilly 5th edition Learning Perl the other day and it's
  great. I am new to programming and Perl as well. I do know my way
  around Linux but I am having problems upgrading from the version that
  was on my OS (Cent OS 5.2) to 5.10. I downloaded Perl 5.10 from
 http://www.cpan.org/authors/id/R/RG/RGARCIA/perl-5.10.0.tar.gz, then
  tar -xvzf perl-5.10.0.tar.gz the package in /usr/local/bin   I then
  followed the README guide that said to:

  ./Configure -des -Dprefix=$HOME/localperl
    make test
    make install

  Now, the first command was probably my mistake because I really have
  no idea what that would do.

 In -Dprefix=$HOME/localperl, the variable $HOME is what you're not getting,
 I think. That configuration line means build a new installation of Perl in
 my home directory and put it all into a folder called localperl.
 (Normally, the build would get put into the directory you choose, but then
 into bin/, lib, share/ and man/ directories there.)

  I've also noticed that now there's a perl5.10.0 located in the /root/
  localperl/bin so I am sure it has something to do with the
  above .Configure command. Can anyone give me some advice on how to get
  5.10 working? I feel like I am close, but nothing so far.

 Apparently, you were logged in as root when you built and installed this
 version of Perl. That was a mistake. You should be root as little as
 possible. (I can tell you were root since $HOME for root = /root. You
 configured it to be built in $HOME/localperl and it was.)

 In any case, I would recommend that you remove entirely the localperl/
 directory in your root home directory, and then start again. Download the
 latest sources as a regular user, in your regular user's $HOME. Then build
 it and install it there. After that you should be able to invoke it with
 this shebang line:
     #!/home/username/localperl/bin/perl

 Hope this helps, T

T,

You are 'so right on'!. Thanks, as you just confirmed what someone
else told me on my local Perl Mongers mailing list, though he didn't
catch that I was logged in as root so thank you for the tip on that.
Now I am starting to really understand why people say that 'You should
be root as little as possible' I will remove the localperl dir
immediately in root. Thanks! I really do appreciate it!

J.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-15 Thread Telemachus
On Wed Jan 14 2009 @  8:17, dolphin_sonar wrote:
 Hi,
 
 I bought the O'Reilly 5th edition Learning Perl the other day and it's
 great. I am new to programming and Perl as well. I do know my way
 around Linux but I am having problems upgrading from the version that
 was on my OS (Cent OS 5.2) to 5.10. I downloaded Perl 5.10 from
 http://www.cpan.org/authors/id/R/RG/RGARCIA/perl-5.10.0.tar.gz, then
 tar -xvzf perl-5.10.0.tar.gz the package in /usr/local/bin   I then
 followed the README guide that said to:
 
 ./Configure -des -Dprefix=$HOME/localperl
   make test
   make install
 
 Now, the first command was probably my mistake because I really have
 no idea what that would do.

In -Dprefix=$HOME/localperl, the variable $HOME is what you're not getting,
I think. That configuration line means build a new installation of Perl in
my home directory and put it all into a folder called localperl.
(Normally, the build would get put into the directory you choose, but then
into bin/, lib, share/ and man/ directories there.)

 I've also noticed that now there's a perl5.10.0 located in the /root/
 localperl/bin so I am sure it has something to do with the
 above .Configure command. Can anyone give me some advice on how to get
 5.10 working? I feel like I am close, but nothing so far.

Apparently, you were logged in as root when you built and installed this
version of Perl. That was a mistake. You should be root as little as
possible. (I can tell you were root since $HOME for root = /root. You
configured it to be built in $HOME/localperl and it was.) 

In any case, I would recommend that you remove entirely the localperl/
directory in your root home directory, and then start again. Download the
latest sources as a regular user, in your regular user's $HOME. Then build
it and install it there. After that you should be able to invoke it with
this shebang line: 
#!/home/username/localperl/bin/perl

Hope this helps, T

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: perl newbie question

2005-07-26 Thread Jay Savage
On 7/25/05, FreeFall [EMAIL PROTECTED] wrote:
 try:
 perl -ne '$line=$_;END{print $line}' yourfile
 
 On Mon, 25 Jul 2005 19:09:50 +0530
 [EMAIL PROTECTED] wrote:
 
 
  hi ,
  I am a perl newbie.
  Can someone suggest a perl command line snippet that will print the last n
  lines of a file.
 
  thanks in advance.
  regards,
  Kaushik
 


perl -e'$n=shift; @x=; print splice(@x, -$n), \n' 123 yourfile 

but really, on the command line you're better off just using tail if
you have it.

HTH,

-- jay 
--
This email and attachment(s): [ x ] blogable; [  ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.dpguru.com  http://www.engatiki.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: perl newbie question

2005-07-25 Thread Edward WIJAYA

On Mon, 25 Jul 2005 21:39:50 +0800, [EMAIL PROTECTED] wrote:


Can someone suggest a perl command line snippet that will print the last  
n

lines of a file.



If you are under unix/linux
just use tail -n command.

However if you really want to go via Perl command line:

$perl -e '
open FH, file or die $!;
@lines = FH;
close FH or die $!;
foreach $i (($#lines - $n) .. $#lines) { print $lines[$i]\n;}
'


--
Regards,
Edward WIJAYA
SINGAPORE

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: perl newbie question

2005-07-25 Thread Keith Worthington

hi ,
I am a perl newbie.
Can someone suggest a perl command line snippet that will print the last n 
lines of a file.


thanks in advance.
regards,
Kaushik


Kaushik,

If you are on the command line I suggest the use of the tail command.

tail -n 123 filename

If you must perform this operation in perl then do a google search for 
perl tail.  You will see that the perl solution is vastly more 
complicated than the above.


--
Kind Regards,
Keith

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Edward WIJAYA wrote:
 On Mon, 25 Jul 2005 21:39:50 +0800, [EMAIL PROTECTED] wrote:
 
 
 Can someone suggest a perl command line snippet that will print the
 last n
 lines of a file.
 
 
 If you are under unix/linux
 just use tail -n command.
 
 However if you really want to go via Perl command line:
 
 $perl -e '
 open FH, file or die $!;
 @lines = FH;
 close FH or die $!;
 foreach $i (($#lines - $n) .. $#lines) { print $lines[$i]\n;} '
 

I shortened this up a bit:

perl -e 'open FH, $filename; @lines=reverse FH; print $lines[$_]
foreach reverse 0..$n;'

Where $filename is replaced with the name of the file and $n is
replaced with the number of lines to display.

Hope that helps!

--Errin

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: perl newbie question

2005-07-25 Thread Matthias Ochs

[EMAIL PROTECTED] wrote:

hi ,
I am a perl newbie.
Can someone suggest a perl command line snippet that will print the last n 
lines of a file.




Why do you want a Perl line for that?
You could just use 'tail' (assuming you run some kind of UNIX).

Matthias

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: perl newbie question

2005-07-25 Thread Jeff 'japhy' Pinyan

On Jul 25, [EMAIL PROTECTED] said:


Can someone suggest a perl command line snippet that will print the last n
lines of a file.


The File::ReadBackwards module does it for you rather simply.

--
Jeff japhy Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Dave Adams wrote:
 Larsen,
 

Hi Dave.  My name is Errin.  Larsen is my surname.

Please, when posting replies, post to the list.


 I am afraid I cannot get your suggested code to work.  Especially
 line that reads foreach reverse 0..$n; 

SNIP

 
 On 7/25/05, Larsen, Errin M HMMA/Information Technology Department
 [EMAIL PROTECTED] wrote: 
 
 I shortened this up a bit:
 
 perl -e 'open FH, $filename; @lines=reverse FH; print $lines[$_]
 foreach reverse 0..$n;' 
 
 Where $filename is replaced with the name of the file and $n is
 replaced with the number of lines to display.
 


First, can you tell us about your environment?  UNIX or Windows? Other
OS?  What version of Perl?  Please give us more details.

Second, you can try making the line more correct:

  perl -e 'open FH, $filename; @lines=reverse(FH);
print($lines[$_]) foreach(reverse(0..$n));'

See how that line does.

Third, as I mentioned, the '$n' part of that command line needs to be
replaced with a number, AND the '$filename' part of that command line
needs to be replaced with a file name.  If I have a file named
'foo.bar', and I want to see the last 25 lines of it, I would type:

  perl -e 'open FH, foo.bar; @lines=reverse FH; print $lines[$_]
foreach reverse 0..25;'

I hope that is helpful!

--Errin

PS  I just re-read you question (above) and I realized maybe you hadn't
realized the code I posted was all on one command line. Make sure you
don't hit 'enter' until the entire command line is typed in.
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: perl newbie question

2005-07-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote:
 hi ,

Hello,

 I am a perl newbie.
 Can someone suggest a perl command line snippet that will print the last n 
 lines of a file.

perl -ne'INIT{$#x=shift()[EMAIL PROTECTED](splice(@x,1),$_)[EMAIL PROTECTED]' 4 
yourfile



John

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: perl newbie question

2005-07-25 Thread FreeFall
try:
perl -ne '$line=$_;END{print $line}' yourfile

On Mon, 25 Jul 2005 19:09:50 +0530
[EMAIL PROTECTED] wrote:

 
 hi ,
 I am a perl newbie.
 Can someone suggest a perl command line snippet that will print the last n 
 lines of a file.
 
 thanks in advance.
 regards,
 Kaushik
 
 Notice: The information contained in this e-mail message and/or attachments 
 to it may contain confidential or privileged information.   If you are not 
 the intended recipient, any dissemination, use, review, distribution, 
 printing or copying of the information contained in this e-mail message 
 and/or attachments to it are strictly prohibited.   If you have received this 
 communication in error, please notify us by reply e-mail or telephone and 
 immediately and permanently delete the message and any attachments.  Thank you


-- 
Whatever you do will be insignificant,but 
the important is you do it!

It doesn't matter who you are, it's what 
you do that takes you far!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl newbie: regexp

2004-06-17 Thread Roberto Etcheverry
This will do it:
perl -n -e 'print if /Testing/m' test.txt
'-p' prints every line in the file so you'll see the matching lines 
twice (one because of '-p' and the other because of 'print') and the 
non-matching lines once (because of '-p').
Look  in 'perldoc perlrun'  for differences on '-p' and '-n'.

raj wrote:
Hello All,
  I am new to perl. I want to display the lines which have
Testing word. I have to do this in command line.
I tried the with following options. Its not work what I expected. It
dispalys all lines.
perl -p -e 'print if /Testing/m' test.txt
ANy help much appreciated!
Regs,
Durai.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 6/2/2004
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Perl newbie: regexp

2004-06-17 Thread Bob Showalter
raj wrote:
 Hello All,
I am new to perl. I want to display the lines which
 have Testing word. I have to do this in command line.
 
 I tried the with following options. Its not work what I expected. It
 dispalys all lines.
 
 perl -p -e 'print if /Testing/m' test.txt

-p should be changed to -n. Also, you don't need the /m modifier on the
regex.

see perldoc perlrun for explanation of -p and -n.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl newbie: regexp

2004-06-17 Thread raj
I am clear. Thanks for replying all.

- Original Message - 
From: Bob Showalter [EMAIL PROTECTED]
To: 'raj' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 5:48 PM
Subject: RE: Perl newbie: regexp


 raj wrote:
  Hello All,
 I am new to perl. I want to display the lines which
  have Testing word. I have to do this in command line.
  
  I tried the with following options. Its not work what I expected. It
  dispalys all lines.
  
  perl -p -e 'print if /Testing/m' test.txt
 
 -p should be changed to -n. Also, you don't need the /m modifier on the
 regex.
 
 see perldoc perlrun for explanation of -p and -n.
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 
 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.707 / Virus Database: 463 - Release Date: 6/15/2004

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie Question

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 1:10 PM, Perl Mail User wrote:
Hello All,
I have a question, I am looking to read the name of the file that I am
passing as an argument to the perl script through the while () part 
of
the script.
You're looking for the $ARGV variable.  It contains the filename you 
need.

Hope that helps.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Perl Newbie Question

2004-05-18 Thread Bob Showalter
Perl Mail User wrote:
 Hello All,

Hi. Providing a real name would be considered polite. Also, please choose a
meaningful subject.

 
 I have a question, I am looking to read the name of the file that I am
 passing as an argument to the perl script through the while () part
 of 
 the script.

The file name is in $ARGV. see perldoc perlvar.

If you need to detect when  switches from one file to another, see the
examples under perldoc -f eof

HTH

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie Question

2004-05-18 Thread Paul Johnson
On Tue, May 18, 2004 at 01:10:27PM -0500, Perl Mail User wrote:

 I have a question, I am looking to read the name of the file that I am 
 passing as an argument to the perl script through the while () part of
 the script.  

$ARGV

perldoc perlvar

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE : Perl Newbie Question

2004-05-18 Thread Jose Nyimi


 -Message d'origine-
 De : Perl Mail User [mailto:[EMAIL PROTECTED]
 Envoyé : mardi 18 mai 2004 20:10
 À : [EMAIL PROTECTED]
 Objet : Perl Newbie Question
 
 Hello All,
 
 I have a question, I am looking to read the name of the file that I am
 passing as an argument to the perl script through the while () part
of
 the script.
 
 Example: perl script.pl 1.txt 2.txt 3.txt
 Each file has information that I am parsing to put into a report but I
 need
 to get the name of the file that I parsed and print that information
as
 well,
 so that way I know what values I am getting from each file associates
with
 what file.
 
 So the output would look like
 
 1.txt (parsed information)
 2.txt (parsed information)
 3.txt (parsed information)
 
 Any assistance would be great.
 Thanks

In addition to
perldoc perlvar
suggested in previous posts you may also give a look to
perldoc perlop
and search for null filehandle.

It's said there :

my_paste

The null filehandle  is special: it can be used to emulate the
behavior of sed and awk. Input from  comes either from standard input,
or from each file listed on the command line. Here's how it works: the
first time  is evaluated, the @ARGV array is checked, and if it is
empty, $ARGV[0] is set to ``-'', which when opened gives you standard
input. The @ARGV array is then processed as a list of filenames. The
loop
while () {
... # code for each line
}
is equivalent to the following Perl-like pseudo code:

unshift(@ARGV, '-') unless @ARGV;
while ($ARGV = shift) {
open(ARGV, $ARGV);
while (ARGV) {
... # code for each line
}
}
except that it isn't so cumbersome to say, and will actually work. It
really does shift the @ARGV array and put the current filename into the
$ARGV variable.

/my_paste



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-03-08 Thread Wiggins d'Anconia
James Edward Gray II wrote:
On Feb 28, 2004, at 1:24 PM, R. Joseph Newton wrote:

Rob Dixon wrote:

David Le Blanc wrote:

Actually, I'd better apologise for calling RPC::p*
secure, simple, or well documented, before anyone comes
at me with a knife :-(


You won't feel a thing. Trust me: I'm an analyst.

/R


Well, this has all been fun [and funny] reading.  For the OP's sake, 
though, how
aboult Wolf's suggestion:
IO::Socket
What kind of experiences have folks had with this?  Do others see this 
as a
useful entry point to Perl networking?


Servers are a lot of what I do.  I've written fork()ing and non-blocking 
servers in Perl just using the basic tools, like the mentioned 
IO::Socket, plus IO::Select, etc.  It's very doable, but I believe it 
falls more under the ...hard things possible slant of Perl 
philosophy.  It's a lot of work.

I can't provide much feedback myself, since I haven't really ventured 
into LAN
programming, but I am interested finding good entry points.


At the top of my To Learn When I Have Time list is POE.  I'll definitely 
get to that before I find myself writing another server.  I think that's 
a much better choice than working out the low-level networking mess by 
hand.

Right, Wiggins?  :D

After a long delay, absolutely... though I still intend on getting into 
the guts of it at some point, but if I needed a server in production I 
would start with POE...

By the way, Snowmass was great! ;-)

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: Perl Newbie

2004-02-28 Thread WC -Sx- Jones
James Edward Gray II wrote:

At the top of my To Learn When I Have Time list is POE.  I'll definitely 
get to that before I find myself writing another server.  I think that's 
a much better choice than working out the low-level networking mess by 
hand.


Yes, there ya go.

POE is the only future of C/S programming.

The lower levels need to be cleaned and presented for the upper layer 
and then the programmer doesnt need to worry about the lower level stuff.

-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Perl Newbie

2004-02-25 Thread David le Blanc



 -Original Message-
 From: WC -Sx- Jones 

You should probably be castrated for that most incredibly obtuse
excuse for help..   You want to get a NEWBIE performing lan 
sniffing and performing TCP packet decoding as a first attempt
at TCP interprocess comms?  That's pure nastiness!

Now I suggest looking up RPC::pServer and RPC::pClient for
settings up a simple, secure effective way of achieving what
you want.   They even come with a working example client and
server.



 [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 25 February 2004 4:32 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Perl Newbie
 
 Darren - Contractor.Westar Peterson wrote:
 I really need immediate help with is TCP communication 
 between a master app
 and a slave app.  As a base upon which to build I would 
 like to set up a
 script on one box that throws a message, any message, 
 through any port to a
 script on another box.  The second script should loop until 
 message is
 received, then print and die.
 
 (Please excuse - I deleted the orginal post.)
 
 Linux boxes are cheap.  Get one which will act as a 
 listener and run 
 several listening deamons.  Reasoning -
 
 Many of the modules you will wish to use may not be available or work 
 incorrectly under Windows 2k/XP.  While these systems are likely to 
 house the running applications which will throw the data to a central 
 lister - it is not required that the listener be localized on 
 the same 
 system - if it were there are better methods of data collection.
 
 Since you specifically requested TCP throwing and catching 
 allow me to 
 get you off on the right foot -
 
 (See comp.lang.perl.moderated for a more complete example.)
 
use strict;
use Net::PcapUtils;
use NetPacket::Ethernet qw(:strip);
use NetPacket::IP qw(:strip);
use NetPacket::TCP;
 
 # This is a generic catcher - modify to taste.
 # Writing a data thrower is left upto you.
 
sub process_pkt {
my($arg, $hdr, $pkt) = @_;
 
my $tcp_obj = 
 NetPacket::TCP-decode(ip_strip(eth_strip($pkt)));
 
if (($tcp_obj-{src_port} == 2525) or
($tcp_obj-{dest_port} == 2525)) {
print($tcp_obj-{data});
}
}
 
Net::PcapUtils::loop(\process_pkt, FILTER = 'tcp');
 
 # 'I' loop eternally waiting for someone to throw data at me...
 
 __END__
 
 You will find a very good discussion (alot at a easy to 
 follow beginning 
 level) of TCP and such in Network Programming with Perl
 
 Perl is alot like Fortran in that complex things can be 
 easily represented.
 
 -Sx-
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-02-25 Thread Rob Dixon
David Le Blanc wrote:

 -Original Message-
 From: WC -Sx- Jones

You should probably be castrated for that most incredibly obtuse
excuse for help.

Do you more about Sx's gender than I do? ;)

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Perl Newbie

2004-02-25 Thread David le Blanc
 -Original Message-
 From: Rob Dixon [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 25 February 2004 10:04 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Perl Newbie
 
 David Le Blanc wrote:
 
  -Original Message-
  From: WC -Sx- Jones
 
 You should probably be castrated for that most incredibly obtuse
 excuse for help.
 
 Do you more about Sx's gender than I do? ;)

No, but, in some cultures shudder

Actually, I'd better apologise for calling RPC::p* 
secure, simple, or well documented, before anyone comes
at me with a knife :-(

 
 Rob
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-02-25 Thread Rob Dixon
David Le Blanc wrote:

 Actually, I'd better apologise for calling RPC::p*
 secure, simple, or well documented, before anyone comes
 at me with a knife :-(

You won't feel a thing. Trust me: I'm an analyst.

/R




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-02-25 Thread WC -Sx- Jones
David le Blanc wrote:
You should probably be castrated for that most incredibly obtuse
excuse for help..   You want to get a NEWBIE performing lan 
sniffing and performing TCP packet decoding as a first attempt
at TCP interprocess comms?  That's pure nastiness!
Heh, well, it's not a beginners subject.  Besides, I produced the 
cleanest code - using modules - which a dedicated beginner should 
understand.  In my own defense:

If a programmer programs in FORTRAN 20 years - they need a break; so 
providing them with Perl (any Perl) is a godsend IYWMO;

:-D


Now I suggest looking up RPC::pServer and RPC::pClient for
settings up a simple, secure effective way of achieving what
you want.   They even come with a working example client and
server.
Hmmm, what were you saying about nasty?  :) Here, allow me to make it 
worse - a fingerd inetd (sic) demon replacement:

#!/usr/bin/perl -w

# in.fingerd
# Detects, stops, and reports finger requests  attacks...
# Modified from tchrist's code.
use strict;
use diagnostics;
use Sys::Syslog;
# read Code - set Variables

print 

This server is not allowing finger requests.
If you are having trouble, or need to look up
a user on this server, please contact either
[EMAIL PROTECTED]   or
[EMAIL PROTECTED]
Thank you for your understanding in this matter,

Systems Administrator/Webmaster
http://www/cgi/mail?yourid
;

print This notice was served (and logged) at ,
scalar localtime,  local time.\n\n;
# Set the userID, if known...
my $usrID = `/usr/bin/whoami`;
my $target = @ARGV ? $ARGV[0] : 'unknown';
my $mailAdmin   = '[EMAIL PROTECTED]';
my $mailProject = '[EMAIL PROTECTED]';
my $SENDMAIL= '/usr/lib/sendmail';
$| = 1;

open (MAIL, | $SENDMAIL $mailAdmin) ||
die ($0:  Fatal Error!  Cannot open sendmail: $!\n);
print MAIL Reply-to: $mailProject\n;
print MAIL From: 'in.fingerd.Tracking.Server'\n;
print MAIL To: 'CompanyName.Server.SysAdmin'\n;
print MAIL Subject: 'fingerd' service request by $usrID\n;
print MAIL X-Comments: = A Message from the $0 Perl app. =\n;
print MAIL SECURITY:  Access to $0 by (real $ )(effective $ )\n;
print MAIL \n; # To hide 'event' under X-Comments, comment out line...
print MAIL UserID: $usrID tried \'finger $target\' request on \@ , 
scalar localtime;

#print MAIL \n;
#print MAIL Relevant data:\n\n;
#print MAIL `ps -ef ; who ; w ; /top -SnU$usrID`;
print MAIL \n;
print MAIL 
=\n;
print MAIL NOTE:  This message was sent through the in.fingerd Perl 
System, \n;
print MAILMsg Monitor v0.05s (Alpha) by -Sneex- :] (WC Jones), 
JaxPM\n;
print MAIL 
=\n;

print MAIL \n;
close (MAIL);
# and finally - log what was found...
openlog(in.fingerd, ndelay, daemon);
syslog(notice, Local %s tried %s finger request.\n, $usrID, $target);
closelog();
exit;

__END__

It's ugly, but it worked well when I needed to protect myself...

-Sx-
(aka -Sneex- circa 1990's)
[ yes, Rob, I am male; sometimes I answer to the name Bill. ]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Perl Newbie

2004-02-25 Thread David le Blanc

LOL ;-)

I already apologised for the crack about RPC ...
 


[move along, nothing to see here]

 -Original Message-
 From: WC -Sx- Jones 
 [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, 26 February 2004 4:48 AM
 Cc: [EMAIL PROTECTED]
 Subject: Re: Perl Newbie
 
 David le Blanc wrote:
  
  You should probably be castrated for that most incredibly obtuse
  excuse for help..   You want to get a NEWBIE performing lan 
  sniffing and performing TCP packet decoding as a first attempt
  at TCP interprocess comms?  That's pure nastiness!
 
 Heh, well, it's not a beginners subject.  Besides, I produced the 
 cleanest code - using modules - which a dedicated beginner should 
 understand.  In my own defense:
 
 If a programmer programs in FORTRAN 20 years - they need a break; so 
 providing them with Perl (any Perl) is a godsend IYWMO;
 
 :-D
 
 
  Now I suggest looking up RPC::pServer and RPC::pClient for
  settings up a simple, secure effective way of achieving what
  you want.   They even come with a working example client and
  server.
 
 Hmmm, what were you saying about nasty?  :) Here, allow me to make it 
 worse - a fingerd inetd (sic) demon replacement:
 
 #!/usr/bin/perl -w
 
 # in.fingerd
 # Detects, stops, and reports finger requests  attacks...
 # Modified from tchrist's code.
 
 use strict;
 use diagnostics;
 use Sys::Syslog;
 
 # read Code - set Variables
 
 print 
 
 This server is not allowing finger requests.
 If you are having trouble, or need to look up
 a user on this server, please contact either
 [EMAIL PROTECTED]   or
 [EMAIL PROTECTED]
 
  Thank you for your understanding in this matter,
 
  Systems Administrator/Webmaster
  http://www/cgi/mail?yourid
 
 ;
 
 print This notice was served (and logged) at ,
 scalar localtime,  local time.\n\n;
 
 # Set the userID, if known...
 my $usrID = `/usr/bin/whoami`;
 my $target = @ARGV ? $ARGV[0] : 'unknown';
 
 my $mailAdmin   = '[EMAIL PROTECTED]';
 my $mailProject = '[EMAIL PROTECTED]';
 my $SENDMAIL= '/usr/lib/sendmail';
 
 $| = 1;
 
 open (MAIL, | $SENDMAIL $mailAdmin) ||
  die ($0:  Fatal Error!  Cannot open sendmail: $!\n);
 
 print MAIL Reply-to: $mailProject\n;
 print MAIL From: 'in.fingerd.Tracking.Server'\n;
 print MAIL To: 'CompanyName.Server.SysAdmin'\n;
 print MAIL Subject: 'fingerd' service request by $usrID\n;
 print MAIL X-Comments: = A Message from the $0 Perl app. 
 =\n;
 print MAIL SECURITY:  Access to $0 by (real $ )(effective $ )\n;
 
 print MAIL \n; # To hide 'event' under X-Comments, comment 
 out line...
 print MAIL UserID: $usrID tried \'finger $target\' request on \@ , 
 scalar localtime;
 
 #print MAIL \n;
 #print MAIL Relevant data:\n\n;
 #print MAIL `ps -ef ; who ; w ; /top -SnU$usrID`;
 
 print MAIL \n;
 print MAIL 
 =\n;
 print MAIL NOTE:  This message was sent through the in.fingerd Perl 
 System, \n;
 print MAILMsg Monitor v0.05s (Alpha) by -Sneex- :] 
 (WC Jones), 
 JaxPM\n;
 print MAIL 
 =\n;
 
 print MAIL \n;
 close (MAIL);
 
 # and finally - log what was found...
 openlog(in.fingerd, ndelay, daemon);
 syslog(notice, Local %s tried %s finger request.\n, 
 $usrID, $target);
 closelog();
 
 exit;
 
 __END__
 
 It's ugly, but it worked well when I needed to protect myself...
 
 -Sx-
 (aka -Sneex- circa 1990's)
 [ yes, Rob, I am male; sometimes I answer to the name Bill. ]
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Perl Newbie

2004-02-24 Thread Paul Kraus
 Would someone point me to source examples, or module documentation.  I can
 pick up things quickly, but when so much is so new and unexplored, I'm
 afraid I really don't know where to start.  Of course, I will work through
 the tutorial to build some general language proficiency, but I surely
 would
 love to quickly have a very simple communication example to run to bolster
 my courage and to show off to the boss as a work in progress.


Safari.oreilly.com is your friend.
PK


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-02-24 Thread wolf blaum
On Tuesday 24 February 2004 15:49, Peterson, Darren - Contractor.Westar 
generously enriched virtual reality by making up this one:

 Hello, all.  I'm as green a Perl programmer as can be.  As a matter of
 fact, I am green in OO programming and network communications.  I spent 12
 years maintaining FORTRAN code on 1970's mainframe computers.  I do love
 FORTRAN...

welcome to perl then:-)

 But my boss has asked me to coordinate app execution on a handful of mixed
 boxes on a small LAN.  The boxes are W2K and Linux.  A network savvy friend
 of mine suggested Perl.  As I work through a tutorial (Beginning Perl @
 learn.perl.org, anyone have chapter 11?) on Perl starting this morning,
 what I really need immediate help with is TCP communication between a
 master app and a slave app.  As a base upon which to build I would like to
 set up a script on one box that throws a message, any message, through any
 port to a script on another box.  The second script should loop until
 message is received, then print and die.

Look at 

http://modperl.com:9000/perl_networking/source/ch5/

for code examples.
That is code from Lincoln Steins excellent book Network Programming with Perl.
Briefly: read about file handles the non OO way.
Then read about IO::File and IO::Socket.
Both inherit most (all) methods from IO::Handle, thus making the scource of 
your input / the destination of your output pretty arbitrary. ie: reading 
from a socket is no more difficult than reading from a file.
and: www.perldoc.com

Enjoy, Wolf


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-02-24 Thread Rob Dixon
Darren - Contractor.Westar Peterson wrote:

 Hello, all.  I'm as green a Perl programmer as can be.  As a matter of fact,
 I am green in OO programming and network communications.  I spent 12 years
 maintaining FORTRAN code on 1970's mainframe computers.  I do love
 FORTRAN...

 But my boss has asked me to coordinate app execution on a handful of mixed
 boxes on a small LAN.  The boxes are W2K and Linux.  A network savvy friend
 of mine suggested Perl.  As I work through a tutorial (Beginning Perl @
 learn.perl.org, anyone have chapter 11?) on Perl starting this morning, what
 I really need immediate help with is TCP communication between a master app
 and a slave app.  As a base upon which to build I would like to set up a
 script on one box that throws a message, any message, through any port to a
 script on another box.  The second script should loop until message is
 received, then print and die.

 Would someone point me to source examples, or module documentation.  I can
 pick up things quickly, but when so much is so new and unexplored, I'm
 afraid I really don't know where to start.  Of course, I will work through
 the tutorial to build some general language proficiency, but I surely would
 love to quickly have a very simple communication example to run to bolster
 my courage and to show off to the boss as a work in progress.

Hi Darren.

Take a look at

  perldoc perlipc

and check out the module

  IPC::Open2

which works fine on WXP and, I think, should be OK on W2K.

HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Newbie

2004-02-24 Thread WC -Sx- Jones
Darren - Contractor.Westar Peterson wrote:
I really need immediate help with is TCP communication between a master app
and a slave app.  As a base upon which to build I would like to set up a
script on one box that throws a message, any message, through any port to a
script on another box.  The second script should loop until message is
received, then print and die.
(Please excuse - I deleted the orginal post.)

Linux boxes are cheap.  Get one which will act as a listener and run 
several listening deamons.  Reasoning -

Many of the modules you will wish to use may not be available or work 
incorrectly under Windows 2k/XP.  While these systems are likely to 
house the running applications which will throw the data to a central 
lister - it is not required that the listener be localized on the same 
system - if it were there are better methods of data collection.

Since you specifically requested TCP throwing and catching allow me to 
get you off on the right foot -

(See comp.lang.perl.moderated for a more complete example.)

  use strict;
  use Net::PcapUtils;
  use NetPacket::Ethernet qw(:strip);
  use NetPacket::IP qw(:strip);
  use NetPacket::TCP;
# This is a generic catcher - modify to taste.
# Writing a data thrower is left upto you.
  sub process_pkt {
  my($arg, $hdr, $pkt) = @_;
  my $tcp_obj = NetPacket::TCP-decode(ip_strip(eth_strip($pkt)));

  if (($tcp_obj-{src_port} == 2525) or
  ($tcp_obj-{dest_port} == 2525)) {
  print($tcp_obj-{data});
  }
  }
  Net::PcapUtils::loop(\process_pkt, FILTER = 'tcp');

# 'I' loop eternally waiting for someone to throw data at me...

__END__

You will find a very good discussion (alot at a easy to follow beginning 
level) of TCP and such in Network Programming with Perl

Perl is alot like Fortran in that complex things can be easily represented.

-Sx-

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Perl Newbie question: How would you take keyboard input and run a shell scrip with that input?

2003-12-31 Thread Paul Kraus
I don't think you could be vaguer :)
Very basic

#!/usr/bin/perl
# update.pl multiple options command line
my @packages = @ARGV
foreach (@packages){
system(packageexecutableforupdate); 
#with output captured
My $output = `packageexecutableforupdate`;
}

Not tested of course. More info may lend yourself to a better answer.

Paul

 Paul Kraus
 ---
 PEL Supply Company
 Network Administrator
 -Original Message-
 From: Jeff Collins [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 31, 2003 11:44 AM
 To: [EMAIL PROTECTED]
 Subject: Perl Newbie question: How would you take keyboard input and run a
 shell scrip with that input?
 
 For example: I would like for the user to enter the
 name of a software package to use and then call a
 shell script to use that package name to upgrade
 software.
 
 Thanks
 
 =
 Jeffrey T. Collins
 [EMAIL PROTECTED]
 
 __
 Do you Yahoo!?
 Find out what made the Top Yahoo! Searches of 2003
 http://search.yahoo.com/top2003
 
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Perl Newbie - Need good book recommendation

2003-09-30 Thread Perry, Alan
 Big advice #2.  Ebay.  I buy all new books and expensive books through
 trusted sellers for about a 50-60% savings.  Make sure you can pay media
 rate on the shipping.  $4.00.  I routinely buy books for $15-20 here.

I do the same thing, and would add the following sites:

http://www.alibris.com
http://www.half.com
http://www.addall.com

You can get used and new books for much less then the sticker price.

I would just add a word of caution though: sometimes you can find a
really cheap perl book for $4.  Double check that the edition is
relatively new and covers Perl 5.  Otherwise you may get a great deal on
a book about Perl 1.

I would also add http://www.bookpool.com

Great prices, and free shipping to U.S. destinations on orders over $40.

Alan

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl Newbie - Need good book recommendation

2003-09-29 Thread Dan Anderson
 Big advice #2.  Ebay.  I buy all new books and expensive books through
 trusted sellers for about a 50-60% savings.  Make sure you can pay media
 rate on the shipping.  $4.00.  I routinely buy books for $15-20 here.

I do the same thing, and would add the following sites:

http://www.alibris.com
http://www.half.com
http://www.addall.com

You can get used and new books for much less then the sticker price.

I would just add a word of caution though: sometimes you can find a
really cheap perl book for $4.  Double check that the edition is
relatively new and covers Perl 5.  Otherwise you may get a great deal on
a book about Perl 1.

-Dan


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl Newbie - Need good book recommendation

2003-09-28 Thread David Wall


--On Saturday, September 27, 2003 8:06 PM -0400 Ed Yost 
[EMAIL PROTECTED] wrote:

I am a complete newbie to perl and have no programming experience. Do any
of you have a good recommendation on a book or resource for a beginner
such as myself?
A list of good Perl books is maintained at http://learn.perl.org/.  I'd 
suggest either _Learning Perl_ or _Elements of Programming with Perl_.  But 
as TN suggested, you could start with Picking up Perl 
http://www.ebb.org/PickingUpPerl/ for free.  That way you haven't spent 
any money if you decide not to use Perl.  (Hey, it can happen :-)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Perl Newbie - Need good book recommendation

2003-09-28 Thread Jeff Borders
Ed,

Let me throw some advice your way.  These are the books I highly
recommend.  Believe me when I say, I've bought a lot of Perl books.  I
probably have 10-15 right now.

Learning Perl - O'Reilly
Perl:  The Complete Reference - Osborne
Perl Developer's Dictionary - Sams
Perl for System Administration - O'Reilly

You can view the covers and access links to these books on my website.

http://www.jeffborders.com/misc/books.html

Big advice, look for these books on clearance racks at your local
computer store.  we have a Microcenter here in Columbus, Ohio that is
trying to unload a lot of these for $3.99 - 6.99.  I've bought a few
that way.

Big advice #2.  Ebay.  I buy all new books and expensive books through
trusted sellers for about a 50-60% savings.  Make sure you can pay media
rate on the shipping.  $4.00.  I routinely buy books for $15-20 here.

Big advice #3.  Check Amazon's used sellers.  Another source for 50%
off.  I've never paid more than $15-25 this way.

If you want more advice on Perl books, ask me.  I've probably read it
and can tell you what it emphasizes and whether it's suited for a
beginner.

Good luck.

Jeff Borders

ps.  You're not the Ed Yost that works at Softpro, are you?  If so,
we've worked on projects together for NWTitle.  Small World.


On Sat, 2003-09-27 at 20:06, Ed Yost wrote:
 Hi all,
 
 I am a complete newbie to perl and have no programming experience. Do 
 any of you have a good recommendation on a book or resource for a 
 beginner such as myself?
 
 Thanks,
 
 Ed
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perl Newbie - Need good book recommendation

2003-09-28 Thread TN
Ja, 

You can also try a safari subscription - http://safari.oreilly.org if
only as a means to sample a wide assortment of technical books to see
which are most worth buying in hardcopy.

Over the past 15 years I've spent a small fortune on books and paid
subscriptions, and there is an educational value to them.  But most of
that was due to my bias that paying for something made it more likely to
be worth the price.  Now things have changed: 

(1) I realized that the main price for learning is personal commitment -
nobody can make you learn something, and nobody can prevent you; 

(2) There is a heck of a lot of great stuff on the Internet today
compared to even a few years ago and it's easy to find with Google; 

(3) There is an undeniably benevelovent and learning-conducive quality
to free opensource materials compared to money-making products (but you
have to be ready to appreciate it).

More practically, when you have a few tons of books it makes relocation
an expensive pain in the back.  So I decided to donate my $30,000
library (of mostly technical books) to the nearest public library and
start traveling light.

I recommend certain learning to learn materials, such as Photoreading
and the Memory Optimizer from Learning Strategies
(http://www.learningstrategies.com) even if you have to pay for them.
But for Photoreading all you need is the $10 book, not the $250 audio
course and both courses are probably available in slightly used
condition on Amazon at huge discounts.

A great way to learn is to teach.  In that sense many authors have
already been paid in full when the final draft has been produced and
anything else is a bonus.  A superlative teacher, like anyone else who
really adds value will be able to attract many students (customers) who
will voluntarily make contributions (the shareware model).

Instead of buying a lot of books, my preference is to get a good laptop
and Internet connection and rely on free, online resources (including
this mail group) for 99% of my educational content.  Sure, its partly a
matter of principle.  It's also cost-effective.

Long live the Internet and long live OpenSource!

Tristram Nefzger


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perl Newbie - Need good book recommendation

2003-09-27 Thread TN
Hi,

I recommend not buying anything.  After all, perl itself including all
sources are free, and they come will extensive documentation, while the
sources are the ultimate reference.  All you need is online and free and
can be found by googling.  The approach I recommend, is:

 read one or two free, online introductions
 write a few simple programs
 read some of the core perldocs that seem interesting
 write some more programs
 get sources for some free perl applications and read them
 write some more programs
 get sources for some CPAN modules and read them
 write a simple module
 get the perl sources and read them
 write the killer-app in perl and retire rich and famous

A good basic intro to perl is at:
http://www.ebb.org/PickingUpPerl/

Here are some other links to free, online perl tutorials that I've
found:
http://archive.ncsa.uiuc.edu/General/Training/PerlIntro/
http://www.comp.leeds.ac.uk/Perl/start.html
http://www.cclabs.missouri.edu/things/instruction/perl/perlcourse.html

Here's a free Gtk-perl tutorial
http://personal.riverusers.com/~swilhelm/gtkperl-tutorial/

-tristram


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl Newbie - Need good book recommendation

2003-09-27 Thread Marc Adler
* Ed Yost [EMAIL PROTECTED] [2003-09-27 14:29]:
 Hi all,
 
 I am a complete newbie to perl and have no programming experience. Do 
 any of you have a good recommendation on a book or resource for a 
 beginner such as myself?

I'm using O'Reilly's _Learning Perl_ and it's very clear. Like you, I
have no programming experience (except for BASIC and Pascal in high
school over ten years ago of which I remember exactly zero), and find
the book's hand-holding style (jokes, focusing on one specific topic at
a time, building on each concept, etc.) reassuring. I tried using online
tutorials like the other replier suggests, but got lost. I think that
method works if you know something about programming already, because
most of the tutorials I came across (granted, they may not have been the
best ones, and I didn't try hundreds before going for the book) assume a
certain level of familiarity with basic programming concepts which I
didn't have.

-- 
Sat, 27 Sep 2003 16:17:00 -1000
Linux 2.4.20-20.9
Mutt 1.4.1i (2003-03-19)


A legion of French Bosoms could not match the lucid beauty of your toenails!

-- the surreal compliment generator
Marc Adler

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: perl newbie

2002-06-04 Thread Hal Wigoda


 Cut off the fat.

 
 Unix Sys administrator, versed in most shells, ksh, bourne, bash etc.
 
 What is the best way for me to lean perl?
 
 Phil

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: perl newbie

2002-06-04 Thread David T-G

Phil --

...and then [EMAIL PROTECTED] said...
% 
% Unix Sys administrator, versed in most shells, ksh, bourne, bash etc.

Sounds familiar...


% 
% What is the best way for me to lean perl?

Up against a sturdy wall, preferably at an angle of 45 to 65 degrees.

Meanwhile, go and get the camel book, Programming Perl, sit down and
read it a bit, and then keep it as a reference as you write everything
new or convert everything old in perl instead of *sh.  Once you get the
hang of writing in perl (how for and while loops work; variable scope;
subroutines; file and IO handling), then you can go and explore CPAN as
your rich source of already-written modules that do cool things for you,
saving you time, or show you how such things are done, teaching you new
tricks.


% 
% Phil


HTH  HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg25396/pgp0.pgp
Description: PGP signature


Re: perl newbie

2001-05-15 Thread Jos Boumans

Ok, it's hard to help you without knowing the exact error that is generated.
So it would help if you posted that too

furthermore, that bit of code seems to be in order then, altho the first  in
..cgi?tickers=yyyrefresh=x shouldnt be there...

Regards,

Jos Boumans

Peter wrote:

 yes there is a semicolon there.

 -Original Message-
 From: Jos Boumans [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 15, 2001 9:39 AM
 To: Peter Lee
 Cc: [EMAIL PROTECTED]
 Subject: Re: perl newbie

 A quick glance at your code shows a missing ; at the end of
 $refresh=$q-param('refresh')

 check if that's not the problem first!

 Regards,

 Jos Boumans

 Peter wrote:

  hi,
 
   i just started learning perl and i'm kinda stuck
 
   i want to pass two querystrings from an asp page to a perl script.
  ie  ..cgi?tickers=yyyrefresh=x
 
   the script accepts the tickers by itself, but when i try to add the
 refresh
  it says
  i have a compile error, here's how its coded...
 
   so what it does is grabs the ticker name and gets quotes for itthen
  redirects
  me back to the page i requested the info from with the new data.
 
  ---
  my $q = new CGI;
 
  if ($q-param('tickers')) {
  my @tickers = split ' ', $q-param('tickers');
  init;
  getquote $q, ($tickers[0]);
  }
 
  $refresh=$q-param('refresh')
  ---
 
  thanks,
  pete




RE: perl newbie

2001-05-15 Thread Peter

yes, semicolon is there.


-Original Message-
From: Jos Boumans [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:39 AM
To: Peter Lee
Cc: [EMAIL PROTECTED]
Subject: Re: perl newbie


A quick glance at your code shows a missing ; at the end of
$refresh=$q-param('refresh')

check if that's not the problem first!

Regards,

Jos Boumans

Peter wrote:

 hi,

  i just started learning perl and i'm kinda stuck

  i want to pass two querystrings from an asp page to a perl script.
 ie  ..cgi?tickers=yyyrefresh=x

  the script accepts the tickers by itself, but when i try to add the
refresh
 it says
 i have a compile error, here's how its coded...

  so what it does is grabs the ticker name and gets quotes for itthen
 redirects
 me back to the page i requested the info from with the new data.

 ---
 my $q = new CGI;

 if ($q-param('tickers')) {
 my @tickers = split ' ', $q-param('tickers');
 init;
 getquote $q, ($tickers[0]);
 }

 $refresh=$q-param('refresh')
 ---

 thanks,
 pete




RE: perl newbie

2001-05-15 Thread Peter

i corrected the  before tickers.

when i append the refresh=x, i get a software error:
Execution of cgi aborted due to compilation errors

without the refresh=x, the script runs fine.

what i'm doing with the refresh value is attaching it to a javascript
redirect window which
sends the value to an asp page.  ie.  .asp?refresh=xsymbol=.

thanks,
peter


-Original Message-
From: Jos Boumans [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 9:45 AM
To: Peter Lee
Cc: [EMAIL PROTECTED]
Subject: Re: perl newbie


Ok, it's hard to help you without knowing the exact error that is generated.
So it would help if you posted that too

furthermore, that bit of code seems to be in order then, altho the first 
in
..cgi?tickers=yyyrefresh=x shouldnt be there...

Regards,

Jos Boumans

Peter wrote:

 yes there is a semicolon there.

 -Original Message-
 From: Jos Boumans [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 15, 2001 9:39 AM
 To: Peter Lee
 Cc: [EMAIL PROTECTED]
 Subject: Re: perl newbie

 A quick glance at your code shows a missing ; at the end of
 $refresh=$q-param('refresh')

 check if that's not the problem first!

 Regards,

 Jos Boumans

 Peter wrote:

  hi,
 
   i just started learning perl and i'm kinda stuck
 
   i want to pass two querystrings from an asp page to a perl script.
  ie  ..cgi?tickers=yyyrefresh=x
 
   the script accepts the tickers by itself, but when i try to add the
 refresh
  it says
  i have a compile error, here's how its coded...
 
   so what it does is grabs the ticker name and gets quotes for itthen
  redirects
  me back to the page i requested the info from with the new data.
 
  ---
  my $q = new CGI;
 
  if ($q-param('tickers')) {
  my @tickers = split ' ', $q-param('tickers');
  init;
  getquote $q, ($tickers[0]);
  }
 
  $refresh=$q-param('refresh')
  ---
 
  thanks,
  pete




Re: perl newbie

2001-05-15 Thread Jos Boumans

I'm afraid that error is too general to make any comments about... maybe it's
more precise if you run the script on the command line?

and if you want to add a refresh option, you need not use javascript per se... a
simple meta refresh tag might suffice in this case.

anyway, i'm afraid i cant help you as such... i'd need to look at the entire
code for that i think

Regards,

Jos Boumans


Peter wrote:

 i corrected the  before tickers.

 when i append the refresh=x, i get a software error:
 Execution of cgi aborted due to compilation errors

 without the refresh=x, the script runs fine.

 what i'm doing with the refresh value is attaching it to a javascript
 redirect window which
 sends the value to an asp page.  ie.  .asp?refresh=xsymbol=.

 thanks,
 peter

 -Original Message-
 From: Jos Boumans [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 15, 2001 9:45 AM
 To: Peter Lee
 Cc: [EMAIL PROTECTED]
 Subject: Re: perl newbie

 Ok, it's hard to help you without knowing the exact error that is generated.
 So it would help if you posted that too

 furthermore, that bit of code seems to be in order then, altho the first 
 in
 ..cgi?tickers=yyyrefresh=x shouldnt be there...

 Regards,

 Jos Boumans

 Peter wrote:

  yes there is a semicolon there.
 
  -Original Message-
  From: Jos Boumans [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, May 15, 2001 9:39 AM
  To: Peter Lee
  Cc: [EMAIL PROTECTED]
  Subject: Re: perl newbie
 
  A quick glance at your code shows a missing ; at the end of
  $refresh=$q-param('refresh')
 
  check if that's not the problem first!
 
  Regards,
 
  Jos Boumans
 
  Peter wrote:
 
   hi,
  
i just started learning perl and i'm kinda stuck
  
i want to pass two querystrings from an asp page to a perl script.
   ie  ..cgi?tickers=yyyrefresh=x
  
the script accepts the tickers by itself, but when i try to add the
  refresh
   it says
   i have a compile error, here's how its coded...
  
so what it does is grabs the ticker name and gets quotes for itthen
   redirects
   me back to the page i requested the info from with the new data.
  
   ---
   my $q = new CGI;
  
   if ($q-param('tickers')) {
   my @tickers = split ' ', $q-param('tickers');
   init;
   getquote $q, ($tickers[0]);
   }
  
   $refresh=$q-param('refresh')
   ---
  
   thanks,
   pete




RE: perl newbie

2001-05-15 Thread Paul

--- Peter [EMAIL PROTECTED] wrote:
 when i append the refresh=x, i get a software error:
 Execution of cgi aborted due to compilation errors

so what are the other errors?

try posting the whole code if necessary, and the whole output to the
screen when you try to run it. =o)

=
print Just another Perl Hacker\n; # edited for readability =o)
=
Real friends are those whom, when you inconvenience them, are bothered less by it than 
you are. -- me. =o) 
=
There are trivial truths and there are great Truths.
 The opposite of a trival truth is obviously false.
 The opposite of a great Truth is also true.  -- Neils Bohr

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/