Submit button to print form and then submit

2004-03-18 Thread Ash Singh
Hi, I am designing a form using cgi and when the user clicks the submit button, the form must print to the users local printer and then submit. Thanking you in advance Ash Singh Programmer email: [EMAIL PROTECTED]

Re: Submit button to print form and then submit

2004-03-18 Thread Wiggins d Anconia
Hi, I am designing a form using cgi and when the user clicks the submit button, the form must print to the users local printer and then submit. Thanking you in advance You are talking client side, and most likely are going to need something like Java, Flash, ActiveX, etc. I love

Re: Submit button to print form and then submit

2004-03-18 Thread Andrew Gaffney
Ash Singh wrote: Thanks, unfortunately its going to be javascript (yak): SCRIPT Language=Javascript /* This script is written by Eric ([EMAIL PROTECTED]) For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use, visit dynamicdrive.com */ function printit(){

next if statement....

2004-03-18 Thread Greg Schiedler
OK I'm trying to modify the code below to recognize an additional next if statement. I have included a snip of the file that the code uses an input. Greg next if /Acct-Session-Id = /;This statment works! # I added this statement. I don't understand the /'s in the statement. And

Re: next if statement....

2004-03-18 Thread Christopher G Tantalo
The slashes are similar to a reg-ex expression on $_ in your example. So basically it checks the line to see if that exists and does something. In your case, for the ip to work, all you would have to do is remove your quotes so the line matches, since the file doesnt have quotes around the ip

Re: next if statement....

2004-03-18 Thread Paul Archer
12:15pm, Greg Schiedler wrote: OK I'm trying to modify the code below to recognize an additional next if statement. I have included a snip of the file that the code uses an input. Greg next if /Acct-Session-Id = /;This statment works! A 'next if /./' is a short form

RE: next if statement....

2004-03-18 Thread Ed Christian
Paul Archer wrote: 12:15pm, Greg Schiedler wrote: OK I'm trying to modify the code below to recognize an additional next if statement. I have included a snip of the file that the code uses an input. Greg next if /Acct-Session-Id = /;This statment works! A 'next if

RE: next if statement....

2004-03-18 Thread Bill Tribley
-Original Message- From: Greg Schiedler [mailto:[EMAIL PROTECTED] Sent: Thursday, March 18, 2004 2:16 PM To: [EMAIL PROTECTED] Subject: next if statement OK I'm trying to modify the code below to recognize an additional next if statement. I have included a snip of the file that

FW: next if statement....

2004-03-18 Thread Bill Tribley
Oops, sorry for the empty reply. Greg, It is a common misconception that regular expressions act like text. If you are looking for this string: NAS-IP-Address = 192.168.0.1 you must escape all the special characters like this: NAS\-IP\-Address = \192\.168\.0\.1\ Quotes do not work within

Uploading file

2004-03-18 Thread Camilo Gonzalez
Okay, I'm totally stumped. I'm trying to upload a file using a browser and a file upload field and saving the file to my server. The code is as follows: my $filename = $cgiobj-param('uploaded_file'); my $fh = $cgiobj-upload('uploaded_file'); open (OUTFILE, ../featImages/$filename)

RE: Uploading file

2004-03-18 Thread Bill Tribley
Camilo, You are getting the uploaded filename/object, which you should treat as read-only, confused with the final destination on your server that you want to write to. What you want to do is to copy the file, not manipulate it. Ordinarily, the file is saved by the CGI object in the tmp

RE: Uploading file

2004-03-18 Thread Ash Singh
Use this as an example, it converts the file to binary mode just in case its not. It also strips out the path of the file coming from the user's local machine. #!/usr/bin/perl use CGI; use strict; my $cgi = new CGI; print $cgi-header; my $query = CGI::new(); use CGI qw(param); my

RE: importing to excel file..

2004-03-18 Thread Tim Johnson
That depends. You can definitely make an excel file using Perl (see the docs for Win32::OLE for a small example), or for the quick and dirty route you can either: A) Create a comma-separated-values file Or B) Create a tab-separated-values file And then you can just open it in Excel later.

Re: importing to excel file..

2004-03-18 Thread Ralf Schaa
Hiremath Arun wrote: Anyone help me in importing data from a text file in to a excel.. maybe you want to have a look at this: Spreadsheet::WriteExcel i cannot tell you if it does what you want, but the 'twinsister' Spreadsheet::ParseExcel::Simple works just fine and it's both a kind of

terminal manipulation in Perl

2004-03-18 Thread Ohad Ohad
Hey, How do I send the cursor to the begining of current line? I want to output a circular string and I want the string to start over on the same line. Thanks _ Tired of spam? Get advanced junk mail protection with MSN 8.

RE: returning hashes, and arrays

2004-03-18 Thread Stuart White
When writing a subroutine, think of it as a miniature program. Something is passed in, processed, and output. Some subs only do one or two of those, but many do all three. Try not to process anything that is not local to the sub. That's how I think of them. I'd prefer to be able to

Re: terminal manipulation in Perl

2004-03-18 Thread Ricardo SIGNES
* Ohad Ohad [EMAIL PROTECTED] [2004-03-18T06:55:48] Hey, How do I send the cursor to the begining of current line? I want to output a circular string and I want the string to start over on the same line. This isn't so much a function of Perl as a function of your terminal. Naturally,

Re: terminal manipulation in Perl

2004-03-18 Thread Michael C. Davis
At 11:55 AM 3/18/04 +, Ohad Ohad wrote: How do I send the cursor to the begining of current line? On which operating system/s do you want to do this? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: terminal manipulation in Perl

2004-03-18 Thread James Edward Gray II
On Mar 18, 2004, at 5:55 AM, Ohad Ohad wrote: Hey, How do I send the cursor to the begining of current line? For most terminals, printing a \r will do the trick. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Multiline Pattern matching for Big File

2004-03-18 Thread Ashish Srivastava
Hi, I want to match a multiline pattern in a very big text file say 500 MB. I can't take all the lines in a string a array in one shot due to memory problem, I have to read file in chunks of line. Any help? Thanks in advance, Ashish __ Do you Yahoo!? Yahoo!

Re: Multiline Pattern matching for Big File

2004-03-18 Thread James Edward Gray II
On Mar 18, 2004, at 8:20 AM, Ashish Srivastava wrote: Hi, I want to match a multiline pattern in a very big text file say 500 MB. I can't take all the lines in a string a array in one shot due to memory problem, I have to read file in chunks of line. Any help? I would think you have to get it

Re: Multiline Pattern matching for Big File

2004-03-18 Thread Wiggins d Anconia
Hi, I want to match a multiline pattern in a very big text file say 500 MB. I can't take all the lines in a string a array in one shot due to memory problem, I have to read file in chunks of line. Any help? What is the pattern like? Is it fixed length? How variable is it? perldoc -f

RE: returning hashes, and arrays

2004-03-18 Thread Stuart White
--- Charles K. Clarkson [EMAIL PROTECTED] wrote: Stuart White [EMAIL PROTECTED] wrote: : : I figured the small snippets, how to : print an array, how to split a string etc., was : better as it was more focused, and would apply : to not just the one example. That's a great way to

RE: returning hashes, and arrays

2004-03-18 Thread Wiggins d Anconia
In the last 6 months I have come to feel that understanding Perl contexts is the most important and difficult thing in the language, so your statement and question very important I don't see the point of the subroutine. If you want to return a hash from a subroutine, use 'return'. Note

Re: Multiline Pattern matching for Big File

2004-03-18 Thread Ashish Srivastava
Hi James, Pattern is not of fixed length. Actually pattern will be giving by user and it could be anything, from one line to say ten lines. Regards, Ashish --- James Edward Gray II [EMAIL PROTECTED] wrote: On Mar 18, 2004, at 8:20 AM, Ashish Srivastava wrote: Hi, I want to match a

Brain stuck on forming a hash

2004-03-18 Thread Chris Zimmerman
Obviously I am a beginner, so bear with me: I have an array, @customers, that has a list of names. For each customer I need to read in a config file, $cust.morestuff.cfg which is formatted: Filename-mask Upload Name Hostname X-Type UserPass I

basic syntax s/..../..../

2004-03-18 Thread David Gilden
Greetings, I want to do the result of a substitution to $newname, but do not have it correct. #!/usr/bin/perl # rename from the Terminal OSX $orig = tina-o1.jpg; ($orig = $newname) =~ s/tina/quest/ig; print $newname; __END__ Then I would like to run from the command line the

RE: basic syntax s/..../..../

2004-03-18 Thread Jayakumar Rajagopal
Dave, Try this : my @files = ; @files = sort @files; foreach(@files){ my $newname = $_; changed $newname =~ s/PIC1000/NEWNAME/; changed rename($_, $newname); } thanks, Jay -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]

running PERL from CMD line OSX

2004-03-18 Thread David Gilden
Trying to run a perl script in OSX shell, and It is not working, what am I missing? here is what I am typing: perl -e test.pl #!/usr/bin/perl #test.pl # rename from the Terminal OSX print hello; __END__ Dave, (kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth,

Re: running PERL from CMD line OSX

2004-03-18 Thread John
Try #perl test.pl -e 'command'one line of program (several -e's allowed, omit programfile) - Original Message - From: David Gilden [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 18, 2004 7:27 PM Subject: running PERL from CMD line OSX Trying to run a perl script

sort stdin and print

2004-03-18 Thread rmck
HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? I thought using the perl sort command would help but it did not... I

RE: sort stdin and print

2004-03-18 Thread Ned Cunningham
I am sure there are better ways but you could save the current ip and check it? #!/usr/bin/perl use strict; my $count = 0; while( ) { #read from stdin one line or record at a time s/ipadd://; #if line has ipadd: remove it s/^ |\t//;

RE: sort stdin and print

2004-03-18 Thread Jayakumar Rajagopal
#!/usr/bin/perl use strict; my $count = 0; my %line ={};# - create a uniq line hash while( ) { #read from stdin one line or record at a time s/ipadd://; #if line has ipadd: remove it s/^ |\t//;

RE: returning hashes, and arrays

2004-03-18 Thread Charles K. Clarkson
Stuart White [mailto:[EMAIL PROTECTED] : : When writing a subroutine, think of it as a miniature : program. Something is passed in, processed, and output. Some : subs only do one or two of those, but many do all three. Try : not to process anything that is not local to the sub. : : That's

Re: sort stdin and print

2004-03-18 Thread Wiggins d Anconia
HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? Ok then do that ;-) I thought using the perl sort command

Re: sort stdin and print

2004-03-18 Thread John W. Krahn
Rmck wrote: HI Hello, I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? The best way to store unique values is to use a

Perl from Terminal in OSX

2004-03-18 Thread B McKee
From: David Gilden [EMAIL PROTECTED] Date: Thu Mar 18, 2004 12:27:57 PM Canada/Eastern To: [EMAIL PROTECTED] Subject: running PERL from CMD line OSX Trying to run a perl script in OSX shell, and It is not working, what am I missing? here is what I am typing: perl -e test.pl #!/usr/bin/perl

Re: basic syntax s/..../..../

2004-03-18 Thread John W. Krahn
David Gilden wrote: Greetings, Hello, I want to do the result of a substitution to $newname, but do not have it correct. #!/usr/bin/perl use warnings; use strict; # rename from the Terminal OSX $orig = tina-o1.jpg; ($orig = $newname) =~ s/tina/quest/ig; You are assigning

Re: running PERL from CMD line OSX

2004-03-18 Thread John W. Krahn
David Gilden wrote: Trying to run a perl script in OSX shell, and It is not working, what am I missing? here is what I am typing: perl -e test.pl The -e switch treats its argument as a string containing perl code: perl -e 'print hello\n' If you want perl to run a _file_ then you don't

HTML problems in perl running

2004-03-18 Thread Xiangli Zhang
When I run perl script with embedd HTML part in Fedora linux system. It did not output the expected contents included in the body of HTML, but the original codes in the file. i.e. the file is treated as a text file and be opened. Can anybody help me figure out the p? Thanks a lot, Justin

Re: Perl from Terminal in OSX

2004-03-18 Thread Ricardo SIGNES
* B McKee [EMAIL PROTECTED] [2004-03-18T13:48:55] here is what I am typing: perl -e test.pl Change to the directory you saved the script, make sure it's executable with chmod +x test.pl then run it directly ./test.pl ...or if you don't want to make the file +x, you can just

Fwd: Re: HTML problems in perl running

2004-03-18 Thread Xiangli Zhang
Hi, Josimar: The followingsare the file what I ran, and the result what I got actually. Thank you for quick response, Talk to you later, Justin The file is: #!/usr/bin/perluse CGI qw/:standard/;print header(), start_html(-title='Wow!'), h1('Wow!'), 'Look Ma, no hands!', end_html();The

Re: what precisely does one need to know in perl to write a script or a test bench for a RTL code in verilog or vhdl..??

2004-03-18 Thread Paul Johnson
On Wed, Mar 17, 2004 at 02:34:44PM -0800, Shah, Aalok S wrote: hey thanks for the reply!! i actually want to use it as a wrapper around the simulations to check the o/p against some golden resultss awaiting ur response aalok I would suggest taking a look at Test::Differences on CPAN, or

Re: sort stdin and print

2004-03-18 Thread rmck
Thanks John, Thats cool... But, I want to be able to print the numbers that are typos, also. like this 111.111.13473 That script just drops them. Is there a way I could print those at the end of the script after the count of real ip's? Like: Goal Out: 111.111.135.11 111.222.81.97 Total

Re: terminal manipulation in Perl

2004-03-18 Thread Ohad Ohad
UNIX, mainly SunOS From: Michael C. Davis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: terminal manipulation in Perl Date: Thu, 18 Mar 2004 06:30:29 -0600 At 11:55 AM 3/18/04 +, Ohad Ohad wrote: How do I send the cursor to the begining of current line? On which operating system/s

RE: returning hashes, and arrays

2004-03-18 Thread Stuart White
I'm sorry about that. I didn't mean to flame you. It just seemed like you were taking the long way around to solve the problem. It was a year ago. I don't remember who it was, and it's not a big deal anymore. That's funny. When I started reading the documentation a few

Re: terminal manipulation in Perl

2004-03-18 Thread Ohad Ohad
Thanks a lot! That worked great. Ohad From: James Edward Gray II [EMAIL PROTECTED] To: Ohad Ohad [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: terminal manipulation in Perl Date: Thu, 18 Mar 2004 08:18:53 -0600 On Mar 18, 2004, at 5:55 AM, Ohad Ohad wrote: Hey, How do I send the

weird Perl errors

2004-03-18 Thread Andrew Gaffney
I keep getting the following errors in my Apache error log every time a certain script is run: Prototype mismatch: sub Apache::ROOT::cgi_2dbin::showday_2epl::time2str vs ($;$$) at /usr/lib/perl5/5.8.0/Exporter.pm line 59. at /home/httpd/cgi-bin/showday.pl line 4 Prototype mismatch: sub

Re: weird Perl errors

2004-03-18 Thread Randy W. Sims
On 03/19/04 00:58, Andrew Gaffney wrote: I keep getting the following errors in my Apache error log every time a certain script is run: Prototype mismatch: sub Apache::ROOT::cgi_2dbin::showday_2epl::time2str vs ($;$$) at /usr/lib/perl5/5.8.0/Exporter.pm line 59. at

RE: returning hashes, and arrays

2004-03-18 Thread Charles K. Clarkson
Stuart White [EMAIL PROTECTED] wrote: : : I'm sorry about that. I didn't mean to flame : you. It just seemed like you were taking the long : way around to solve the problem. : : It was a year ago. I don't remember who it was, and : it's not a big deal anymore. I've been here awhile

if (!pipe_is_empty) { while() {do_cool_stuff();} }

2004-03-18 Thread Bryan Harris
I have a handy-dandy script that replaces text in files. Very slick: % replace 'dog' 'cat' myfile.txt 1. myfile.txt (1 change) But I'd also like it to be able to act on a pipe if there is one: % cat myfile.txt | replace 'dog' 'cat' My cat has fleas. The problem is I don't want to use the

Re: sort stdin and print

2004-03-18 Thread John W. Krahn
Rmck wrote: From: John W. Krahn [EMAIL PROTECTED] I would do it something like this: #!/usr/bin/perl use warnings; use strict; use Socket; my %IPs; while ( ) { $IPs{ inet_aton( $1 ) }++ if /\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b/; } for ( sort keys

Re: if (!pipe_is_empty) { while() {do_cool_stuff();} }

2004-03-18 Thread Randy W. Sims
On 03/19/04 02:30, Bryan Harris wrote: I have a handy-dandy script that replaces text in files. Very slick: % replace 'dog' 'cat' myfile.txt 1. myfile.txt (1 change) But I'd also like it to be able to act on a pipe if there is one: % cat myfile.txt | replace 'dog' 'cat' My cat has fleas. The