why are you sending
me copies of all email in and out of [EMAIL PROTECTED]?
here you can
have them back
Better yet, get "Learning Perl on Win32 Systems" (O'Reilly) Dan Murphy [EMAIL PROTECTED] EMC Corp. 508-435-1000 x14559 Hopkinton, MA 01748 EMC2 where information lives -----Original Message----- From: Peter Scott [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 12:38 PM To: Kent Mercer Cc: [EMAIL PROTECTED] Subject: Re: platform win ME At 10:12 AM 8/9/01 -0600, Kent Mercer wrote: >----- Original Message ----- >From: "Peter Scott" <[EMAIL PROTECTED]> > > >How do I begin my first script? > > > > > >And how do I save it ? > > > > > >Something simple like "Hello World" > > > > > >Just started 2 days ago > > >Need pointed in the right direction > > > > What platform are you on? Windows, Mac, Unix, VMS, Palm...? Ah, okay, Windows ME. A la Mrs. Beeton, first, get your perl. Go to http://aspn.activestate.com/ASPN/Downloads/ActivePerl/ and download the Windows MSI version (I'm guessing here that Windows ME has support for the MS Installer; if not, get the Windows AS package.) Install it and accept all the defaults. Then, use Notepad to create a file called hw.pl containing the text between the lines below: ------------------------------- #!/usr/bin/perl -w use strict; print "Hello World\n"; ------------------------------- [Some people will argue about putting the use strict line in your first program, but I say, you're going to put it in any program that does anything useful, so why not get in the habit from the beginning.] Then open a command prompt window to the same directory, and type perl hw.pl and tell us if that doesn't work. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
If you need to use double quotes, you can say: print "somebody\@somewhere.com" but if you're not using any other escape sequences or variables, then just use single quotes: print '[EMAIL PROTECTED]' Single quotes force perl to take the string as it is instead of trying to insert the array '@somewhere' into the string. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 3:10 PM To: [EMAIL PROTECTED] Subject: escape sequence for @ How do I print an e-mail address to a file. For example, [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I think that you just need to match the other way around to get the partial match. Instead of looking for the fileline within the name_passed, look for the name_passed within the fileline. Something like this should do the desired partial match, and be shorter and clearer (at least to me, another newbie). while(<FILE>) { chomp; if (/$name_passed/) { ..... ----- Original Message ----- From: "Sofia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 09, 2001 9:59 AM Subject: Matching strings > I am having problems matching strings. I have the > following code that reads a file with computer names > and if a named passed to the script is in the file > print yes otherwise print no, for example. The > computer names are in the format n-4.t-1 meaning node > four on rack 1. > > while(<FILE>) { > $line = $_; > chomp($line); > $_ = $name_passed; # name is the argument passed to > this script > if (/$line/) { > print "yes\n"; > exit 0; > } > } > print "no\n"; > > Now, if the file contains computer n-4.t-1 and I want > to see if computer n-4.t-11 exists in the file (which > it doesn't) the script return yes because it matches > n-4.t-1. However, the file might contain the entry > "t-2" which means that all the nodes on rack 2 need to > be disabled. So, if I passed the script the name of > n-4.t-2, the script should return "yes" because that > nodes is part of rack 2. > > Any ideas anyone??? > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
what's Perl DBI module? How can I execute a web-database in Perl language? thanks in advance
Try this, having put return $value at the end of sub_one my ($numhits, @hits) = @_; for (0 .. $numhits - 1) { $returnedValue = &sub_one(&array_to_hash($_, @hits));} -----Original Message----- From: Birgit Kellner [mailto:[EMAIL PROTECTED]] Sent: 09 August 2001 15:36 To: [EMAIL PROTECTED] Subject: on returning subroutine arguments I have a script that prints out database records after a search operation. For each hit in the database, it calls the subroutine sub_one to first turn the record with the hit into a hash and then print out results in html. Now, there's one of these hash values which I would then like to use in a different sub, and I am wondering how to best go about it. Here's the code so far: ##### main code ##################### my ($numhits, @hits) = @_; # @_ contains output from a different script for (0 .. $numhits - 1) { &sub_one(&array_to_hash($_, @hits)); } ########## end main code ####### begin subroutines sub_one { my %rec = @_; print qq|<br>here is some code with $rec{'one'}, $rec{'two'}, $rec{'three'}.<br>|; my $value = $rec{'three'}; } sub_two { my $value = $_[0]; &query($value); } ########### end subroutines I guess I could just call sub_two with $value as an argument from sub_one: &sub_two($value). But is there a possibility to first return $value from sub_one to the main code and then do something with it there? In other words, if I add "return $value" to sub_one, can I then use it in the main code like this: ########## main code ################# my ($numhits, @hits) = @_; for (0 .. $numhits - 1) { &sub_one(&array_to_hash($_, @hits)); my $value = $_[0]; # is $_[0] here the return argument from sub_one? } ######## end main code Birgit Kellner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------Confidentiality--------------------------. This E-mail is confidential. It should not be read, copied, disclosed or used by any person other than the intended recipient. Unauthorised use, disclosure or copying by whatever medium is strictly prohibited and may be unlawful. If you have received this E-mail in error please contact the sender immediately and delete the E-mail from your system. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Readers: awk has a function called 'getline' which reads the next line of input without changing control of the script. My input file contains pairs of records. When I find a record that matches my search pattern, I want that record and the next record. In awk, I used the 'getline' which did just that. How can I do this in perl? Does using the $* variable get me there? -------------------------------------------------- #!/usr/bin/perl -w use strict ; ## If the record ends in 03 then capture this record and the next one. while (<>) { chomp ; if ( /03$/) { print ; #print this record, now how do I capture just the next record? } ------------------------------------------------------------ Thanks, Frank -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Kent there will be some key things in your IIS or PWS that you will need to do. Your .pl needs to be associated like this. go to control panel. open administrative tools folder. Open computer management folder. In right window you should see a internet information services icon with a + Open it. Find and highlight default website, right click and go to properties. You should see a tabed folder called home directory open it, go to configuration tab look at bottom middle of window, open configuration and you will see all your file .ext (ie look for .pl) make sure it has this for the file extension for .pl .pl D:\perl\bin\perl.exe "%s"%s (notice the "%S"%S this is a windows thing). Place your activestate perl in any folder except www, mine is located on C: drive and my webserver is on C: but two different folders, when install installing active state it should give you option of .pl to be associated with, if not go to instructions at the top. let me know how it goes. -----Original Message----- From: Peter Scott [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 11:38 AM To: Kent Mercer Cc: [EMAIL PROTECTED] Subject: Re: platform win ME At 10:12 AM 8/9/01 -0600, Kent Mercer wrote: >----- Original Message ----- >From: "Peter Scott" <[EMAIL PROTECTED]> > > >How do I begin my first script? > > > > > >And how do I save it ? > > > > > >Something simple like "Hello World" > > > > > >Just started 2 days ago > > >Need pointed in the right direction > > > > What platform are you on? Windows, Mac, Unix, VMS, Palm...? Ah, okay, Windows ME. A la Mrs. Beeton, first, get your perl. Go to http://aspn.activestate.com/ASPN/Downloads/ActivePerl/ and download the Windows MSI version (I'm guessing here that Windows ME has support for the MS Installer; if not, get the Windows AS package.) Install it and accept all the defaults. Then, use Notepad to create a file called hw.pl containing the text between the lines below: ------------------------------- #!/usr/bin/perl -w use strict; print "Hello World\n"; ------------------------------- [Some people will argue about putting the use strict line in your first program, but I say, you're going to put it in any program that does anything useful, so why not get in the habit from the beginning.] Then open a command prompt window to the same directory, and type perl hw.pl and tell us if that doesn't work. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
way to go everyone, keep it up -----Original Message----- From: Casey West [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 11:15 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Over 9000 posts I am ready to clean out my [EMAIL PROTECTED] inbox because mutt can't handle the messages. I have 9000 messages saved since May 20. That's less than 3 months and we've had 9000 messages! I want to say congrats to both the beginners and the experts here. Thank you for making this list work. Casey West -- Shooting yourself in the foot with BASIC (compiled) You shoot yourself in the foot with a BB using a SCUD missile launcher. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]