Can someone Help me out with this
Hi , Can some one provide me with a perl script for this: Problem: ci_cmd1="abcdef", // line1 ci_cmd2="ghijk", // line2 ci_cmd3="lmnop", // line3 ci_cmd4="pqrst", // line4 I want to delete line 1 and 2 and the above should look like as shown below: ci_cmd1="lmnop", ci_cmd2="pqrst", A prompt response will be highly appreciated. Regards., Avi - Original Message - From: "Troy May" <[EMAIL PROTECTED]> To: "Bill Lyles" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 17, 2002 8:52 AM Subject: RE: Definition > It just makes dealing with quotes alot easier. And you don't need to escape > the extra quotes within it. For example, > > > print "value=\"true\""; > > print qq!value="true"!; > > print qq/value="true"/; > > > are all the same. The qq uses the next character instead of the " > character. Then you must end the line with the same character you started > with. (qq!!, qq//, qq~~) > > Sorry, it's hard to explain in an email. > > > -Original Message- > From: Bill Lyles [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 7:31 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: Definition > > > Ok, Sorry about that > > Anyway what do you mean perldoc -f qq? > > what does the ~qq mean? > > - Original Message - > From: "fliptop" <[EMAIL PROTECTED]> > To: "Bill Lyles" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, April 16, 2002 8:53 PM > Subject: Re: Definition > > > > Bill Lyles wrote: > > > > > href="file://C:\Program Files\Common Files\Microsoft > Shared\Stationery\"> > > > As I am somewhat new to perl > > > > > > can someone tell me what this means > > > > > > $header = qq~ > > > > > > I understand the header but what is the qq~ for? > > > > > > perldoc -f qq > > > > btw, it's considered bad form to send html-ized email to the list. > > > > > > -- > > 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] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can someone Help me out with this
> Problem: > ci_cmd1="abcdef", // line1 > ci_cmd2="ghijk", // line2 > ci_cmd3="lmnop", // line3 > ci_cmd4="pqrst", // line4 > > I want to delete line 1 and 2 and the above should look like > as shown below: > > ci_cmd1="lmnop", > ci_cmd2="pqrst", Where are these lines? Are they in a file? Are they in a variable? Can you post some code that you've tried? Cheers, -dave > Regards., > Avi Like Avi from Snatch? =P "Got anything to declare?" "Yeah, don't go to England." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can someone Help me out with this
you should try this. $old="abcdef"; $new="lmnop"; $ci_cmd1 = s/$old/$new/;#this substitutes the old value with the new one. regards, Ian David Gray wrote: > > Problem: > > ci_cmd1="abcdef", // line1 > > ci_cmd2="ghijk", // line2 > > ci_cmd3="lmnop", // line3 > > ci_cmd4="pqrst", // line4 > > > > I want to delete line 1 and 2 and the above should look like as > > shown below: > > > > ci_cmd1="lmnop", > > ci_cmd2="pqrst", > > Where are these lines? Are they in a file? Are they in a variable? Can > you post some code that you've tried? > > Cheers, > > -dave > > > Regards., > > Avi > > Like Avi from Snatch? =P > "Got anything to declare?" > "Yeah, don't go to England." > > -- > 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]
RE: Can someone Help me out with this
I don't know if this is the most efficient way to do it, but it worked. #!C:\Perl\bin\perl.exe -w use strict; my $infile = qq(C\:\\cmd.txt); my $outfile = qq(C\:\\cmdout.txt); my $cmdline; open(IN,"<$infile") or die "Whoops! Look what happened. $! \n"; open(OUT,">$outfile") or die "Could not open \'cuz $! \n"; while() { my $line = $_; if(($line =~ /cmd1/) or ($line =~ /cmd2/)) { next; } else { $_ =~ s/(\n)+(\r)+//g; ($cmdline) = split(/,/,$line); print OUT "$cmdline \n"; } } close(OUT); # blue light special on aisle #6 close(IN); # we've got the suspect surrounded 1; Scot R. -Original Message- From: Avanish Pathak [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 2:02 AM To: Troy May; Bill Lyles; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Can someone Help me out with this Hi , Can some one provide me with a perl script for this: Problem: ci_cmd1="abcdef", // line1 ci_cmd2="ghijk", // line2 ci_cmd3="lmnop", // line3 ci_cmd4="pqrst", // line4 I want to delete line 1 and 2 and the above should look like as shown below: ci_cmd1="lmnop", ci_cmd2="pqrst", A prompt response will be highly appreciated. Regards., Avi - Original Message - From: "Troy May" <[EMAIL PROTECTED]> To: "Bill Lyles" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 17, 2002 8:52 AM Subject: RE: Definition > It just makes dealing with quotes alot easier. And you don't need to escape > the extra quotes within it. For example, > > > print "value=\"true\""; > > print qq!value="true"!; > > print qq/value="true"/; > > > are all the same. The qq uses the next character instead of the " > character. Then you must end the line with the same character you started > with. (qq!!, qq//, qq~~) > > Sorry, it's hard to explain in an email. > > > -Original Message- > From: Bill Lyles [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 7:31 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: Definition > > > Ok, Sorry about that > > Anyway what do you mean perldoc -f qq? > > what does the ~qq mean? > > - Original Message - > From: "fliptop" <[EMAIL PROTECTED]> > To: "Bill Lyles" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, April 16, 2002 8:53 PM > Subject: Re: Definition > > > > Bill Lyles wrote: > > > > > href="file://C:\Program Files\Common Files\Microsoft > Shared\Stationery\"> > > > As I am somewhat new to perl > > > > > > can someone tell me what this means > > > > > > $header = qq~ > > > > > > I understand the header but what is the qq~ for? > > > > > > perldoc -f qq > > > > btw, it's considered bad form to send html-ized email to the list. > > > > > > -- > > 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] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can someone Help me out with this
Whoops, correction... else { $line =~ s/(\n)+(\r)+//g; # use $line instead of $_ ($cmdline) = split(/,/,$line); print OUT "$cmdline \n"; } -Original Message- From: inSite Internet Solutions [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 9:39 AM To: Avanish Pathak; Troy May; Bill Lyles; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Can someone Help me out with this I don't know if this is the most efficient way to do it, but it worked. #!C:\Perl\bin\perl.exe -w use strict; my $infile = qq(C\:\\cmd.txt); my $outfile = qq(C\:\\cmdout.txt); my $cmdline; open(IN,"<$infile") or die "Whoops! Look what happened. $! \n"; open(OUT,">$outfile") or die "Could not open \'cuz $! \n"; while() { my $line = $_; if(($line =~ /cmd1/) or ($line =~ /cmd2/)) { next; } else { $_ =~ s/(\n)+(\r)+//g; ($cmdline) = split(/,/,$line); print OUT "$cmdline \n"; } } close(OUT); # blue light special on aisle #6 close(IN); # we've got the suspect surrounded 1; Scot R. -Original Message- From: Avanish Pathak [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 2:02 AM To: Troy May; Bill Lyles; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Can someone Help me out with this Hi , Can some one provide me with a perl script for this: Problem: ci_cmd1="abcdef", // line1 ci_cmd2="ghijk", // line2 ci_cmd3="lmnop", // line3 ci_cmd4="pqrst", // line4 I want to delete line 1 and 2 and the above should look like as shown below: ci_cmd1="lmnop", ci_cmd2="pqrst", A prompt response will be highly appreciated. Regards., Avi - Original Message - From: "Troy May" <[EMAIL PROTECTED]> To: "Bill Lyles" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 17, 2002 8:52 AM Subject: RE: Definition > It just makes dealing with quotes alot easier. And you don't need to escape > the extra quotes within it. For example, > > > print "value=\"true\""; > > print qq!value="true"!; > > print qq/value="true"/; > > > are all the same. The qq uses the next character instead of the " > character. Then you must end the line with the same character you started > with. (qq!!, qq//, qq~~) > > Sorry, it's hard to explain in an email. > > > -Original Message- > From: Bill Lyles [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 7:31 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: Definition > > > Ok, Sorry about that > > Anyway what do you mean perldoc -f qq? > > what does the ~qq mean? > > - Original Message - > From: "fliptop" <[EMAIL PROTECTED]> > To: "Bill Lyles" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Tuesday, April 16, 2002 8:53 PM > Subject: Re: Definition > > > > Bill Lyles wrote: > > > > > href="file://C:\Program Files\Common Files\Microsoft > Shared\Stationery\"> > > > As I am somewhat new to perl > > > > > > can someone tell me what this means > > > > > > $header = qq~ > > > > > > I understand the header but what is the qq~ for? > > > > > > perldoc -f qq > > > > btw, it's considered bad form to send html-ized email to the list. > > > > > > -- > > 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] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Checking who called a cgi-script
Hy, I need to check which server (or better: which formular) gave data to a cgi-script (executed this script) (I am writing on a contact-script but I dont want every server to be able to execute this script!) How could I do this? (A link or source for informations would be enough) Many thanks! regards Sebastian Nerz PS I am sorry for my english - it's quite terrible! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Checking who called a cgi-script
I usually do a combination of things. * You can check domains, but they can be spoofed, so that in itself is not a cure. It's a start. * Does the site have a static IP? You can set the script only to run if called from that IP. Once again 'spoofable' but less than a domain on its own. * Use the CGI.pm module's built-in data limit function. You can set POST_MAX to a reasonable level to avoid buffer overflow issues, or just set DISABLE_UPLOADS = 1 if no files are going to be uploaded. * Are you on UNIX? Most of my sites are on some flavor of *NIX and I run my scripts suid. You can explicitly tell the script that it can run -only- as the user, not even as the httpd daemon. (#!/usr/bin/perl -U with the script directory chmod'd 4711) Scot Robnett inSite Internet Solutions [EMAIL PROTECTED] [EMAIL PROTECTED] -Original Message- From: Sebastian Nerz [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 10:22 AM To: [EMAIL PROTECTED] Subject: Checking who called a cgi-script Hy, I need to check which server (or better: which formular) gave data to a cgi-script (executed this script) (I am writing on a contact-script but I dont want every server to be able to execute this script!) How could I do this? (A link or source for informations would be enough) Many thanks! regards Sebastian Nerz PS I am sorry for my english - it's quite terrible! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CGI/Perl-usertracking
Hi John, > I'm sorry, I don't understand your question very well. > Can you give an example? No. I didn't start to arrange a program yet, so there is no specific problem. I just want your hints which way would be a good idea. What modules to use and so on. I never had to manage any usertracking and I don't know how to do it using Perl only. My task is to provide a Perl/CGI-solution to pass the results of a first search into a second search within these results. And I'm looking for an elegant way of passing the data (which can be quite a lot) and it would be nice not to lose the user who started the query. Any idea how I could do this is welcome! > By "standard-Perl only", do you mean only using > modules that come with Perl? Yes! Or better: those which are usually installed. > > --- Sven <[EMAIL PROTECTED]> wrote: > > Hello all! > > > > Can anyone give me a hint what I should do? > > > > I want to realize a search in the results of a > > previous search. So I > > need to name the users (ID) and store/pass the > > results. > > > > 1) How can I do this with standard-Perl only? (main > > question) > > 2) What would be the recommended way if no > > restriction? > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session management
hi all of you, how can i create a session using win32 system, on linux, there is a session module out there - aspn and cpan - but am searching about such one for win32 but i didn't find. can anyone tell me how to manage session through win32. thx Hytham Shehab -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]