RE: I am a real begginer to perl......

2001-05-02 Thread King, Jason
David Monarres writes .. >I am alos fairly new with perl and completely new with perl one liners. >I see how you can use regex's on the cmd line to edit a file (sort of >sed ish). I tried this > >$ perl -pe 's/hello/reverse($1)/' -i test > >all it print's is reverse. I was wondering if you knew

RE: Simple HTML Page

2001-05-02 Thread King, Jason
Helio S. Junior writes .. >I have a HTML Page in our Intranet. This page contains >some tables which i have to update from time to time. > >The information i have to add to the tables on this >page comes from OutLook e-mails. > >I would like to add a button on this Page in order to >read OutLook

Re: I am a real begginer to perl......

2001-05-02 Thread David Monarres
I am alos fairly new with perl and completely new with perl one liners. I see how you can use regex's on the cmd line to edit a file (sort of sed ish). I tried this $ perl -pe 's/hello/reverse($1)/' -i test all it print's is reverse. I was wondering if you knew of a way to read in a word and rev

Simple HTML Page

2001-05-02 Thread Helio S. Junior
Hello, I have a HTML Page in our Intranet. This page contains some tables which i have to update from time to time. The information i have to add to the tables on this page comes from OutLook e-mails. I would like to add a button on this Page in order to read OutLook e-mails and update this p

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks for the advice. I would've thought about that sooner or later, but better sooner than later. And this is not on a high traffic site, in fact only a few select folks know about it. Anyhow, hows this... my $manpage = param("manpage"); if ($manpage =~ /^([-\@\w.]+)$/) {

RE: execute at win2k system command with options.

2001-05-02 Thread King, Jason
Casey West writes .. >On Wed, May 02, 2001 at 05:37:27PM -0400, Casey West wrote: >: On Wed, May 02, 2001 at 03:16:41PM -0700, Peter Lemus wrote: >: : Hi, >: : I'm having some trouble trying to execute the followin >: : command from a perl script. >: : rmdir /s /q username #this works from the

RE: finding common records between two files

2001-05-02 Thread King, Jason
Mike Stussie writes .. >thanks for the response... let me clarify the description of >file 'B' > >File 'B' record format is exactly like file 'A', both look like this: >(btw - the file is a registrant file for a newsletter) > >File 'A' >BCSJN::Joe User::1 >N.Main::Anytown::MO::None::Unknown

Re: CGI Problem

2001-05-02 Thread SunDog
Ok ...after the #!/usr/bin/perl ... fix the next thing to check for is ^M this is the extra CR that Windoze editors leave behind ... you can open this file up on a linux box using fox-editor it will show any offending ^M's delete them ...then try again ... regards SunDog ==

Re: A couple issues with Find and directories

2001-05-02 Thread Me
> -f and -M > 0 or push @logs_old, $_ ; oops, that should of course have been: -f and (-M >= 0 or push @logs_old, $_ );

RE: Can't figure out find()

2001-05-02 Thread King, Jason
Ask Bjoern Hansen writes .. >On Mon, 30 Apr 2001, Meije Oppenhuizen wrote: > >> I am probably doing something very wrong here, but can >someone tell me >> why >> >> #!/usr/bin/perl -w >> >> use File::Find; >> >> print "$arg"; >> open(LISTFILE, "> /home/meyeo/testfile") or die "Can't open the

Re: GD::Graph

2001-05-02 Thread Sean O'Leary
At 06:44 PM 5/2/2001, you wrote: >Can anyone help me understand why the following code is being ignored? > >$my_graph->set_x_label_font(GD::Font->Giant); > >Kevin Need more code! It's like saying "Why doesn't this print?" print 'Print this!'; What I didn't show you was that earlier in my progr

RE: Error opening file? - Solved!

2001-05-02 Thread King, Jason
Ask Bjoern Hansen writes .. >On Fri, 27 Apr 2001, Billy Joedono wrote: > >[...] >> Convert to regular Unix format and problem solved! More >question: how can I >> force vi to show these, or better yet, how can I get >dos2unix or unix2dos >> in Linux? > >perl -i -pe 's/\r\n/\n/' file_to_be_con

RE: CGI Problem

2001-05-02 Thread King, Jason
Joe McMahon writes .. >On Wed, 2 May 2001, J. Patrick Lanigan wrote: > >> I am getting an "Internal Server Error" returned to my >browser. The error >> log shows the following: >> >> "[Wed May 2 00:04:39 2001] [error] [client 192.168.0.10] >Premature end of >> script headers: /path/to/filenam

Re: eliminating duplicate lines in a file

2001-05-02 Thread cherukuwada subrahmanyam
Hi, Thanks for that. Iam collecting /etc/passwd files from a large number of unix systems and generating the list of UIDs.Out of this list, I want to pick up the next available UID. When I generate the list, there will be lot of duplicate UIDs, which I want to get rid of. I hope that explains.

Re: Directory mapping in NT

2001-05-02 Thread Sean O'Leary
At 08:42 AM 5/2/2001, you wrote: > I am working on automating some file imports from a file that are > saved on a server to a database on a local machine. It gets a bit ugly > because we need to run the text file through a conversion program from a > vendor before it gets imported into

Re: CGI Problem

2001-05-02 Thread Matt Cauthorn
It's almost certainly (to my mind) your http header. Make sure and use the CGI.pm module, as it makes this type of thing extremely easy to write. --- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote: > I am getting an "Internal Server Error" returned to my browser. The error > log shows the follow

Re: FTP package

2001-05-02 Thread Matt Cauthorn
I may be wrong, but it looks like machine 2 doesn't have the Net::FTP module installed. Try this to see if it is: perldoc Net::Ftp If it's installed, you'll see some text pop up straight away. As for machine one, I'm not too sure. I'm sure someone on the list can help! ~Matt C. --- [EMAIL P

GD::Graph

2001-05-02 Thread kevin sezen
Can anyone help me understand why the following code is being ignored? $my_graph->set_x_label_font(GD::Font->Giant); Kevin

Re: execute at win2k system command with options.

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 05:37:27PM -0400, Casey West wrote: : On Wed, May 02, 2001 at 03:16:41PM -0700, Peter Lemus wrote: : : Hi, : : I'm having some trouble trying to execute the followin : : command from a perl script. : : rmdir /s /q username #this works from the command line : : in win2k. :

Re: execute at win2k system command with options.

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 03:16:41PM -0700, Peter Lemus wrote: : Hi, : I'm having some trouble trying to execute the followin : command from a perl script. : rmdir /s /q username #this works from the command line : in win2k. : I tried: : system 'rmdir /s /q $user' # no luck. Any : suggestion

execute at win2k system command with options.

2001-05-02 Thread Peter Lemus
Hi, I'm having some trouble trying to execute the followin command from a perl script. rmdir /s /q username #this works from the command line in win2k. I tried: system 'rmdir /s /q $user' # no luck. Any suggestions? = Peter Lemus Computer Networks Engineer [EMAIL PROTECTED] My Dad

Re: system call question

2001-05-02 Thread Kevin Meltzer
On Wed, May 02, 2001 at 04:20:49PM -0500, J. Patrick Lanigan ([EMAIL PROTECTED]) spew-ed forth: [snip] > my $manpage = param("manpage"); > my @output = `man $manpage | perl -pe 's/(?:.\cH)//g'`; #Thanks Paul Please read perlsec and untaint $manpage (by hand, or with

Re: A couple issues with Find and directories

2001-05-02 Thread Me
> I want to list all files only within a directory > (do not descend to sub-directories). > [and catch log files needing to be added] How about something like: $^T = $last_full_log_seconds; while (glob $logs) { -f and -M > 0 or push @logs_old, $_ ; } $^T is the start tim

Re: String deconstruction?

2001-05-02 Thread David H. Adler
On Wed, May 02, 2001 at 09:00:27PM +0200, M.W. Koskamp wrote: > > - Original Message - > From: David H. Adler <[EMAIL PROTECTED]> > > For what it's worth two ideas present themselves to me. > > > > --code > > > > use Benchmark; > > > > $x = "huzzah!"; > > $times = shift || 10

Re: Compile error

2001-05-02 Thread Kailash Subramanian
This is what I found. ls -la /opt/perl5/lib/5.6.1/PA-RISC1.1/auto/File/ total 2 drwxr-x--- 3 vobadm nfsgroup96 May 2 15:42 . drwxr-x--- 21 vobadm nfsgroup 1024 May 2 15:42 .. drwxr-x--- 2 vobadm nfsgroup96 May 2 15:42 Glob ls -la /opt/perl5/lib/5.6.1/PA

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Man, this list rocks, and I am really atarting to love this language. Thanks for all your suggestions. Ultimately, Paul is the winner :) The code follows works wonders: #!/usr/bin/perl -w use strict; use CGI qw(:standard); print header(), start_html("Online Manpag

Re: Compile error

2001-05-02 Thread Curtis Jewell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 2 May 2001, Kailash Subramanian wrote: > > > But I see the module. > $ ls -l /opt/perl5/lib/5.6.1/PA-RISC1.1/File Wrong directory - it's not looking for the .pm file, it's looking for the .so (or whatever other extension) file that's compile

Re: problem with PATH

2001-05-02 Thread Kailash Subramanian
Infact now I changed the perl installation directory to the one under /opt, but now I am getting another error. /home/xena/vobadm/PERL/perl/perl-RUN/opt/perl5/bin/perl Makefile.PL Checking if your kit is complete... Looks good Can't locate loadable object for module File::Glob in @INC (@INC con

Re: String deconstruction?

2001-05-02 Thread David H. Adler
On Wed, May 02, 2001 at 02:59:04PM -0400, Timothy Kimball wrote: > > : > substring => sub {for (0..length($x) - 1){$q = $_ }} > > This one isn't getting the characters from the string, it's just > counting from zero to one less than the length of the string. Dang. that was meant to be C<$q =

Re: system call question

2001-05-02 Thread Paul
--- Casey West <[EMAIL PROTECTED]> wrote: > On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: > : Thanks to Paul and Mike for the quick response. > : > : Now, does anyone know how I can trim out the unwanted charecters > from the > : output of a man page so that I can display i

Re: problem with PATH

2001-05-02 Thread Curtis Jewell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 2 May 2001 [EMAIL PROTECTED] wrote: > > > > All, > I am trying to install a perl module on HP-UX. So when I run the following > command I am getting an error as shown below. I know that perl is looking under > wrong dir for this module.

Re: DBD::DB2 installation problem

2001-05-02 Thread Curtis Jewell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 2 May 2001, rmd wrote: > HELP, please! > I´ve tried to install DBD:DB2 using CPAN or compiling it directly via > perl Makefile.PL, then make test and i get always this error: Note that DBD::DB2's README file specifically requires that the DB

Re: parsing XML code -> problem with HASH

2001-05-02 Thread Me
I'm not sure what you are saying your problem is, and I may have this wrong, but since no one else has answered, I'll have a go. To generate a new, anonymous hash that is a copy of an existing named hash, use {}. Put the {} brackets around some expression that can be seen by perl as a hash, eg:

Re: Compile error

2001-05-02 Thread Kailash Subramanian
But I see the module. $ ls -l /opt/perl5/lib/5.6.1/PA-RISC1.1/File total 26 -rw-r- 1 vobadm nfsgroup 12808 Apr 14 07:48 Glob.pm Thx Kailash From: [EMAIL PROTECTED] (Casey West) AT INTERNET on 05/02/2001 03:31 PM To: Kailash Subramanian/ATL/ALLTELCORP cc: [EMAIL PROTE

Re: Compile error

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 04:30:08PM -0400, [EMAIL PROTECTED] wrote: : : : : All, : When I run this command, I get the following error message. : $ perl Makefile.PL : Checking if your kit is complete... : Looks good : Can't locate loadable object for module File::Glob in @INC (@INC contains:

Re: system call question

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: : Thanks to Paul and Mike for the quick response. : : Now, does anyone know how I can trim out the unwanted charecters from the : output of a man page so that I can display it in a browser? Well, you could use the man2html utili

clean up man output (was Re: system call question)

2001-05-02 Thread Me
This group is great, but sometimes deja's still the best source! ;> http://groups.google.com/groups?q=%22man+output%22+perl > Now, does anyone know how I can trim out the unwanted charecters from the > output of a man page so that I can display it in a browser? > > Sample as is: > > NNAAMMEE

Compile error

2001-05-02 Thread Kailash . Subramanian
All, When I run this command, I get the following error message. $ perl Makefile.PL Checking if your kit is complete... Looks good Can't locate loadable object for module File::Glob in @INC (@INC contains: /opt/perl5/lib/5.6.1/PA-RISC1.1 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks to Paul and Mike for the quick response. Now, does anyone know how I can trim out the unwanted charecters from the output of a man page so that I can display it in a browser? Sample as is: NNAAMMEE ls - list directory contents SSYYNNOOPPSSIISS llss [_O_P_T

Re: eliminating duplicate lines in a file

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 11:11:20AM -0700, Paul wrote: : : --- "M.W. Koskamp" <[EMAIL PROTECTED]> wrote: : > > : open FH, "lines.txt" || die $!; : > > : my %uniq; : > > : map{$uniq{$_}=1 and print $_ unless $uniq{$_} }; : : lol -- one better(ish): : print map { $uniq{$_} ? '' : $uniq{$_}=$_

Re: system call question

2001-05-02 Thread Mike Lacey
yep -- and backticks sets $? with the return code as well, so you get both if you want. - Original Message - From: "Paul" <[EMAIL PROTECTED]> To: "J. Patrick Lanigan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:47 PM Subject: Re: system call question > > ---

Re: system call question

2001-05-02 Thread Paul
--- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote: > Now that I have CGI working with apache on my server, I am > experimenting. > Anyhow, I wrote the following script and was wondering how to capture > the output of a system call. I am trying to capture the output so that > I can format it for

Re: String deconstruction?

2001-05-02 Thread Paul
--- Paul Cotter <[EMAIL PROTECTED]> wrote: > There are many ways, here is one that does not involve an array > > my $str = 'paul cotter'; > print $1,$1 while ( $str =~ /^(.)/g ); > > The above prints ppaauull ccooeerr (just to show it is printing > 1 at a time - twice). nope -- /^(.)/ is

Re: I am a real begginer to perl......

2001-05-02 Thread Me
> "how do I tell perl to open a file for reading, do various > commands, and then output those changes to a new file"??? Perl has some great one-liner shortcuts for writing filters. First, -e lets you put perl on the command line: perl -e ' print "foo\n" ' Prints foo Second, -p conve

Re: system call question

2001-05-02 Thread Mike Lacey
Patrick, Put your command in backticks and set a variable to its output (like this $var = `man $manpage`;) - Original Message - From: "J. Patrick Lanigan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:25 PM Subject: system call question > Now that I have C

system call question

2001-05-02 Thread J. Patrick Lanigan
Now that I have CGI working with apache on my server, I am experimenting. Anyhow, I wrote the following script and was wondering how to capture the output of a system call. I am trying to capture the output so that I can format it for the browser. #!/usr/bin/perl -w use strict; use CGI qw(:standa

Re: I am a real begginer to perl......

2001-05-02 Thread Me
> beginner ... recommended books other than the camel ... Apparently, the original Camel had two chapters that beginners would love -- "Common Tasks in Perl" and "Real Perl Programs". Later Camels removed this sort of material. The essence of this material, greatly expanded and wonderfully edit

Re: String deconstruction?

2001-05-02 Thread Paul Cotter
There are many ways, here is one that does not involve an array my $str = 'paul cotter'; print $1,$1 while ( $str =~ /^(.)/g ); The above prints ppaauull ccooeerr (just to show it is printing 1 at a time - twice). It is going therough $str one character at a time seeing if it matches "." w

Re: String deconstruction?

2001-05-02 Thread Timothy Kimball
: > substring => sub {for (0..length($x) - 1){$q = $_ }} This one isn't getting the characters from the string, it's just counting from zero to one less than the length of the string. -- tdk

Re: String deconstruction?

2001-05-02 Thread M.W. Koskamp
- Original Message - From: David H. Adler <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:46 PM Subject: Re: String deconstruction? > On Wed, May 02, 2001 at 11:28:14AM -0700, Ross Larner wrote: > > Hello. I am attempting to print a string one character at a

Re: Using Email

2001-05-02 Thread Mike Lacey
I always use Net::SMTP - very good module. Mike Mike Lacey www.tek-tips.com -- a friendly, flame free, environment for computer professionals and students Perl forum at: http://www.tek-tips.com/gthreadminder.cfm/lev2/4/lev3/32/pid/219 - Original Message - From: "Phillip Bruce" <[EMAIL P

Re: String deconstruction?

2001-05-02 Thread David H. Adler
On Wed, May 02, 2001 at 11:28:14AM -0700, Ross Larner wrote: > Hello. I am attempting to print a string one character at a time. Right now I am >using one while loop with chop to create a new string, the reverse of the original >string, then another while loop with chop on the reversed string

Re: String deconstruction?

2001-05-02 Thread Sean McAfee
Ross Larner <[EMAIL PROTECTED]> wrote: >Hello. I am attempting to print a string one character at a time. >Right now I am using one while loop with chop to create a new string, >the reverse of the original string, then another while loop with chop >on the reversed string to print out the characte

problem with PATH

2001-05-02 Thread Kailash . Subramanian
All, I am trying to install a perl module on HP-UX. So when I run the following command I am getting an error as shown below. I know that perl is looking under wrong dir for this module. I am trying to use my own perl under my home dir. There is also another perl installation directory und

Re: String deconstruction?

2001-05-02 Thread Timothy Kimball
: Hello. I am attempting to print a string one character at a time. Right now I am :using one while loop with chop to create a new string, the reverse of the original :string, then another while loop with chop on the reversed string to print out the :characters. I'm sure there's a more stra

Re: String deconstruction?

2001-05-02 Thread M.W. Koskamp
print join "\n", split "", "abcdefg"; split will give you a list where "abcdefg" is splitted on nothing. so it will contain (a,b,c,d,e,f,g). Join "\n" will join the items in the list with newlines between em. So it will print: a b c d e f If you want to reuse the array do this: my @chars = spli

Re: String deconstruction?

2001-05-02 Thread Paul
--- Ross Larner <[EMAIL PROTECTED]> wrote: > Hello. I am attempting to print a string one character at a time. > Right now I am using one while loop with chop to create a new string, > the reverse of the original string, then another while loop with chop > on the reversed string to print out th

Oracle/CGI/Perl (was: RE: I am a real begginer to perl......)

2001-05-02 Thread Timothy Kimball
: I am also a beginner and wondering if there are any other recommended : books other than the camel book from O'Reilly. I have been asked to : display information from the Oracle Database on the web using Perl and : CGI. So far, I mostly know how to check for patterns. Gulp!! O'Reilly has al

RE: I am a real begginer to perl......

2001-05-02 Thread Paul
--- [EMAIL PROTECTED] wrote: > I am also a beginner and wondering if there are any other recommended > books other than the camel book from O'Reilly. I have been asked to > display information from the Oracle Database on the web using Perl > and CGI. So far, I mostly know how to check for patte

String deconstruction?

2001-05-02 Thread Ross Larner
Hello. I am attempting to print a string one character at a time. Right now I am using one while loop with chop to create a new string, the reverse of the original string, then another while loop with chop on the reversed string to print out the characters. I'm sure there's a more straight-f

Re: I am a real begginer to perl......

2001-05-02 Thread M.W. Koskamp
Programming the perl DBI would be a good book. Also learning perl from O'reilly is fairly good. If you get perl from activestate.com you get the perl documentation in html format. Very good and worth reading. Try read the different tutorials. I suggest perlsyn, perlop, and perl sub. Also make a n

Re: eliminating duplicate lines in a file

2001-05-02 Thread Paul
--- "M.W. Koskamp" <[EMAIL PROTECTED]> wrote: > > : open FH, "lines.txt" || die $!; > > : my %uniq; > > : map{$uniq{$_}=1 and print $_ unless $uniq{$_} }; lol -- one better(ish): print map { $uniq{$_} ? '' : $uniq{$_}=$_ } ; #:op __ Do You Ya

RE: I am a real begginer to perl......

2001-05-02 Thread ODoisnea
I am also a beginner and wondering if there are any other recommended books other than the camel book from O'Reilly. I have been asked to display information from the Oracle Database on the web using Perl and CGI. So far, I mostly know how to check for patterns. Gulp!! Thanks for any input. O

Re: I am a real begginer to perl......

2001-05-02 Thread Paul
--- n6tadam <[EMAIL PROTECTED]> wrote: > Dear All, > > I wonder if someone could help me. I have been programming in bash > for years > now, but I have decided that I would like to use perl. > > My question is: "how do I tell perl to open a file for reading, do > various commands, and then outp

Re: eliminating duplicate lines in a file

2001-05-02 Thread M.W. Koskamp
- Original Message - From: Casey West <[EMAIL PROTECTED]> To: M.W. Koskamp <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; cherukuwada subrahmanyam <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 6:45 PM Subject: Re: eliminating duplicate lines in a file > On Wed, Ma

Re: eliminating duplicate lines in a file

2001-05-02 Thread Timothy Kimball
brahmanyam <[EMAIL PROTECTED]> wrote: : > Hi, : > Iam reading flat text file of 10 lines. Each line has got data of : > maximum 10 characters. : > I want to eliminate duplicate lines and blank lines out of that file. : > i.e. something like sort -u in unix. : : Got plenty of memory? =o) : :

Re: eliminating duplicate lines in a file

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 07:39:03PM +0200, M.W. Koskamp wrote: : : - Original Message - : From: Paul <[EMAIL PROTECTED]> : To: cherukuwada subrahmanyam <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> : Sent: Wednesday, May 02, 2001 7:08 PM : Subject: Re: eliminating duplicate lines in a file :

DBD::DB2 installation problem

2001-05-02 Thread rmd
HELP, please! I´ve tried to install DBD:DB2 using CPAN or compiling it directly via perl Makefile.PL, then make test and i get always this error: [root@linux DBD-DB2-0.75]# make test make[1]: Entering directory '/instalar/DBD-DB2-0.75/Constants' make[1]: Leaving directory '/instalar/DBD-DB2-0.75

Re: eliminating duplicate lines in a file

2001-05-02 Thread M.W. Koskamp
- Original Message - From: Paul <[EMAIL PROTECTED]> To: cherukuwada subrahmanyam <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 7:08 PM Subject: Re: eliminating duplicate lines in a file > > --- cherukuwada subrahmanyam <[EMAIL PROTECTED]> wrote: > > Hi, > > Ia

Re: test if a directory exists if it does delete it else print directory does not exists

2001-05-02 Thread Paul
--- Peter Lemus <[EMAIL PROTECTED]> wrote: > HI Folks, > > I need to delete some directories, specified in > removedir.txt, I'll like to check whether the file > exists or not, if it doesn't I need to print file has > been deleted. this is what I've done so far. > > use file::spec; > use win32

Re: eliminating duplicate lines in a file

2001-05-02 Thread Paul
--- cherukuwada subrahmanyam <[EMAIL PROTECTED]> wrote: > Hi, > Iam reading flat text file of 10 lines. Each line has got data of > maximum 10 characters. > I want to eliminate duplicate lines and blank lines out of that file. > i.e. something like sort -u in unix. Got plenty of memory? =o)

Re: CGI Problem

2001-05-02 Thread Joe McMahon
On Wed, 2 May 2001, J. Patrick Lanigan wrote: > I am getting an "Internal Server Error" returned to my browser. The error > log shows the following: > > "[Wed May 2 00:04:39 2001] [error] [client 192.168.0.10] Premature end of > script headers: /path/to/filename" > > I have set the directory and

Re: eliminating duplicate lines in a file

2001-05-02 Thread Sean O'Leary
At 07:57 AM 5/2/2001, you wrote: >Hi, >Iam reading flat text file of 10 lines. Each line has got data of >maximum 10 characters. >I want to eliminate duplicate lines and blank lines out of that file. >i.e. something like sort -u in unix. > > > >Is there any easy way of doing it in perl??? >th

Re: I am a real begginer to perl......

2001-05-02 Thread M.W. Koskamp
Read the documentation in IO::Handle and FileHandle - Original Message - From: n6tadam <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 1:27 PM Subject: I am a real begginer to perl.. > Dear All, > > I wonder if someone could help me. I have been programming

RE: CGI Problem

2001-05-02 Thread J. Patrick Lanigan
Thank you, Thank you, Thank you!! I did everything you said and it worked. So, I wanted to find out what specifically the problem was. Turns out it was the absense of the -w switch on the shebang. Thanks again, Patrick > Gary Stainburn wrote: > > Hi Patick, > > You say you've set the permission

Re: IF statements

2001-05-02 Thread Paul Cotter
> There is no CASE statement in PERL. Instead you use something called SWITCH. There is no switch either - and if there was it would be lower case. There are many ways to emulate it; here is but one: :HOMOSTART# this is just a label - it can be ignored $_ = $caseVar; /^man$/and

Re: FTP package

2001-05-02 Thread Sean O'Leary
At 07:07 AM 5/2/2001, you wrote: >I've written a script to FTP files. I've included the Net::FTP package but >when I run the script in 2 different machines, I get these 2 error messages: > >machine 1 >Can't locate object method "new" via package "Net::FTP::A" at >/usr/local/lib/per >l5/5.00503/Net

Re: Perl and NT

2001-05-02 Thread Sean O'Leary
At 03:03 PM 5/1/2001, you wrote: >Does anyone know of a way to use perl and CGI to have the following: > >html page w/ form to get stdin from the user for username and >password.(basic), >pass the variables to the perl script which then modifies permissions for a >specific folder on NT >and allows

A couple issues with Find and directories

2001-05-02 Thread Craig Moynes/Markham/IBM
Hi, I am passing a directory into my perl program. I want to list all files only within that directory (do not descend to sub-directories). I have tried using the File::Find::find command but to no avail. Here are some code snippets: xi#!/usr/bin/perl -w ##

Managing NT

2001-05-02 Thread Hofmann, Matthias
Hi there! Is there someone, who knows how to manage the access rights configuration of a shared NT-Directory via perl? I already found a working perl script at CPAN which is able to change the access rights on the local hard disk, but what I always do via the GUI of NT is changing the access rig

Thankyou All.......

2001-05-02 Thread n6tadam
Dear List, I would just like to say thank you to all the people who help me with getting perl to open to and read a file. I know that this is such a simple thing to do, but having someone else explain it, definately clarified it for me :-))) Thanks Again, Regards, Thomas Adam Please note that

RE: finding common records between two files

2001-05-02 Thread Stussie, Mike
thanks for the response... let me clarify the description of file 'B' File 'B' record format is exactly like file 'A', both look like this: (btw - the file is a registrant file for a newsletter) File 'A' BCSJN::Joe User::1 N.Main::Anytown::MO::None::Unknown::[EMAIL PROTECTED] File 'B' JK

Re: eliminating duplicate lines in a file

2001-05-02 Thread Greg Meckes
You can try this old trick: # where @data is from flatfile %seen = (); @uniq = (); #will contain only unique elements foreach $item(@data) { unless($seen{$item}) { $seen{$item} = 1; if ($item =~ /\S+/g) { push(@uniq,

Directory mapping in NT

2001-05-02 Thread Aaron Petry
I am working on automating some file imports from a file that are saved on a server to a database on a local machine. It gets a bit ugly because we need to run the text file through a conversion program from a vendor before it gets imported into the DB, and this conversion utility requ

Re: I am a real begginer to perl......

2001-05-02 Thread Greg Meckes
#open file for reading open (READ, "file2.txt"); # you'll then have to loop through # the READ file with a foreach loop # or a while loop to perform # "various commands" while () { #perform command # Then write to the file print WRITE "$value\n"; } close(READ); close(WRITE); Greg

Re: Got a project for Perl but need some help

2001-05-02 Thread Michael Lamertz
Andrew Teo ([EMAIL PROTECTED]) wrote: > Just curious, how would you send an attachment? Get MIME::Lite from CPAN. -- If we fail, we will lose the war. Michael Lamertz | [EMAIL PROTECTED] / [EMAIL PROTECTED] Nordstr. 49 | http://www.lamertz.net 507

eliminating duplicate lines in a file

2001-05-02 Thread cherukuwada subrahmanyam
Hi, Iam reading flat text file of 10 lines. Each line has got data of maximum 10 characters. I want to eliminate duplicate lines and blank lines out of that file. i.e. something like sort -u in unix. Example: if the file contains: abcdef  dfsdf abcdef dfsdf 12334 Then the output should be:

FTP package

2001-05-02 Thread antonio . garcia-espada
I've written a script to FTP files. I've included the Net::FTP package but when I run the script in 2 different machines, I get these 2 error messages: machine 1 Can't locate object method "new" via package "Net::FTP::A" at /usr/local/lib/per l5/5.00503/Net/FTP/A.pm line 18. machine2 Can't loca

Re: Pack trouble

2001-05-02 Thread Michael Lamertz
Hans ([EMAIL PROTECTED]) wrote: > Someone please enlighten me. I can't for the world figure out what is > wrong here. Your understanding of the packer is wrong :-) > - I create a main window. > > - In this window I create a frame. You don't need a frame that covers the whole window - except fo

I am a real begginer to perl......

2001-05-02 Thread n6tadam
Dear All, I wonder if someone could help me. I have been programming in bash for years now, but I have decided that I would like to use perl. My question is: "how do I tell perl to open a file for reading, do various commands, and then output those changes to a new file"??? Thanks in Anticipati

parsing XML code -> problem with HASH

2001-05-02 Thread Mika . P . Aho
Hi, I am having a small problem while parsing the XML code. First of all, here comes snip of the sourcecode: ... if ( $NN->[$j] eq "OBU" ) # if OBU was found... { $OBU = $NN->[$j+1]; for $e ( 0..@$OBU ) # loop through the content of OBU { if ( ref($OBU->[$e]) eq "HASH" ) { $

FTP

2001-05-02 Thread Nigel G Romeril
Hi, Try using libnet, this is a library that allows you to use ftp, telnet etc from Perl. Avzilable from CPAN or using PPM. Regards, Nigel R Gary Stainburn wrote: > Hi Daniel, > > assuming you're not worried about the ftp failing, you could do > something line: > > open(FTP,"|ftp -ivn")|| die

Re: how to ??

2001-05-02 Thread Gary Stainburn
Hi Daniel, assuming you're not worried about the ftp failing, you could do something line: open(FTP,"|ftp -ivn")|| die can't fork ftp: $!\n; print FTP "open ftp.me.com\n"; print FTP "user me mypassword\n"; print FTP "put myfile\n"; print FTP "get theirfile\n"; print FTP "bye\n"; close(FTP); Ho

Re: CGI Problem

2001-05-02 Thread Gary Stainburn
Hi Patick, You say you've set the permissions for the dir and the script to 755. Have you checked the permissions for the parent directories? Also, put the '-w' on the perl line, and 'use strict'. lastly, put the following line as the 1st statement in the script print STDERR "\nGot this far\n

Re: Can't figure out find()

2001-05-02 Thread Ask Bjoern Hansen
On Mon, 30 Apr 2001, Meije Oppenhuizen wrote: > I am probably doing something very wrong here, but can someone tell me > why > > #!/usr/bin/perl -w > > use File::Find; > > print "$arg"; > open(LISTFILE, "> /home/meyeo/testfile") or die "Can't open the ffin > thingy!"; > print LISTFILE "\n"; >

RE: Error opening file? - Solved!

2001-05-02 Thread Ask Bjoern Hansen
On Fri, 27 Apr 2001, Billy Joedono wrote: [...] > Convert to regular Unix format and problem solved! More question: how can I > force vi to show these, or better yet, how can I get dos2unix or unix2dos > in Linux? perl -i -pe 's/\r\n/\n/' file_to_be_converted_to_unix_lines.txt perl -i -pe 's/\