Hi!
Your code looks OK.
What you need is a LOCAL web server installed on your computer (please note
that a web server is SOFTWARE, basically). You can get, e.g., Apache for
many platforms, including all Windows versions, at www.apache.org . Then,
you need a Perl interpreter, too. For Windows, Act
[EMAIL PROTECTED] [[EMAIL PROTECTED]] quoth:
*>Dose anyone know of a exsiting Perl module that will test to see what tape drives
are available on Unix box?
*>
*>I looked through the some of the CPAN stuff but didn't find anything that looked
like what I might need.
None that I'm aware of as i
Hello.
I am a total perl newbie who is running perl v5.6 on a RedHat Linux v7.1
system.
I am using a perl program as a Web proxy redirector, a program that I would
very much like to improve the performance of. If I improve the performance
of perl itself (by building it with different compile
Doh. I don't know how many times I looked at it and still didn't see
the word 'mail' prior to my username.
Thanks to all who responded.
Mike
Marcelo Ramos wrote:
>
> El Sun, 29 Jul 2001 10:31:11 -0500
> Mike Rodgers <[EMAIL PROTECTED]> escribió:
>
> >On page 23 of Learning Perl, there are comm
OK, since noone replied to my late-night question of yesterday, I gave it a
go and came up with the following code, which seems to work but, as all my
code, seems clumsy, and I don't really understand what I did here:
A form returns a query string like
"userid=someuser&copies=1&dbkey=25&copies
On Mon, Jul 30, 2001 at 01:50:55PM -0700, Greg Tomczyk wrote:
> Anyone have any ideas? maybe find2perl is not the answer; I do not know..
find2perl is exactly what you want. It takes a command line as you'd give
it to find and converts it into Perl. You can then take this code and use
it direct
At 10:56 AM 7/30/01 +, Mel Matsuoka wrote:
>At 01:39 PM 07/30/2001 -0700, [EMAIL PROTECTED] wrote:
> >> "Stephen P. Potter" <[EMAIL PROTECTED]> said:
> >
> >> |
> >> | open (MAIL, "|/usr/sbin/sendmail $email")
> >> |
> >> | to which you should by the way add
> >> |
> >> | or
On Mon, Jul 30, 2001 at 04:40:56PM -0400, Casey West wrote:
: On Mon, Jul 30, 2001 at 02:19:00PM -0700, Paul wrote:
: :
: : --- Casey West <[EMAIL PROTECTED]> wrote:
: : > Yes, I imagine it would be a fun thing for beginners to see. Some
: : > might try hard to understand them. A teaser would b
On Mon, Jul 30, 2001 at 02:19:00PM -0700, Paul wrote:
:
: --- Casey West <[EMAIL PROTECTED]> wrote:
: > Yes, I imagine it would be a fun thing for beginners to see. Some
: > might try hard to understand them. A teaser would be fine but, the
: > entirety of a one-liner thread most likley doesn't
--- Casey West <[EMAIL PROTECTED]> wrote:
> Yes, I imagine it would be a fun thing for beginners to see. Some
> might try hard to understand them. A teaser would be fine but, the
> entirety of a one-liner thread most likley doesn't belong on the
> beginners lists[*]. Not to mention, Fun With P
--- David Blevins <[EMAIL PROTECTED]> wrote:
> Truly astounding.
lol
> From: Paul [mailto:[EMAIL PROTECTED]]
> > --- David Blevins <[EMAIL PROTECTED]> wrote:
> > > > perl -nle 'print if !$seen{$_}++'
> > >
> > > $seen{$_}
> > >
> > > Tries to lookup the line in the hash of lines we've alr
At 10:56 AM 07/30/2001, Mel Matsuoka wrote:
>At 01:39 PM 07/30/2001 -0700, [EMAIL PROTECTED] wrote:
>>> "Stephen P. Potter" <[EMAIL PROTECTED]> said:
>>
>>> |
>>> | open (MAIL, "|/usr/sbin/sendmail $email")
>>> |
>>> | to which you should by the way add
>>> |
>>> | or die "sen
At 01:39 PM 07/30/2001 -0700, [EMAIL PROTECTED] wrote:
>> "Stephen P. Potter" <[EMAIL PROTECTED]> said:
>
>> |
>> | open (MAIL, "|/usr/sbin/sendmail $email")
>> |
>> | to which you should by the way add
>> |
>> | or die "sendmail: $!\n";
>>
>> This probably does not do what y
On Mon, 30 Jul 2001, Greg Tomczyk wrote:
> I am new to this list and hope someone, will be able to help me. I am
> trying to do a find/search on a directory tree and store the results of
> that find into an array which I can then manipulate. I can run find using
> the system command an put conten
Hello,
I am new to this list and hope someone, will be able to help me. I am
trying to do a find/search on a directory tree and store the results of
that find into an array which I can then manipulate. I can run find using
the system command an put contents into a flat file, but I would like to
u
On Mon, Jul 30, 2001 at 02:16:42PM -0600, Canavan, John wrote:
: Hopefully, at least some beginners would find this playful and entertaining
: enough that they'd be willing to work a little harder to understand the
: code. When I'm learning a new language, I enjoy reading playful but hard
: code
> "Stephen P. Potter" <[EMAIL PROTECTED]> said:
> |
> | open (MAIL, "|/usr/sbin/sendmail $email")
> |
> | to which you should by the way add
> |
> | or die "sendmail: $!\n";
>
> This probably does not do what you think it does. It is almost always
> worthless to check the s
Oops, slight mistake:
At 12:39 PM 7/30/01 -0700, Peter Scott wrote:
>At 08:57 PM 7/30/01 +0300, alex stan wrote:
>>I need to search for a string in httpd.conf file , ( the string is :
>>CustomLog /var/log/httpd/site.com/access_log ) and then replace
>>inside them site.com with site_com. I mentio
Truly astounding.
From: Paul [mailto:[EMAIL PROTECTED]]
>
> --- David Blevins <[EMAIL PROTECTED]> wrote:
> > > perl -nle 'print if !$seen{$_}++'
> >
> > $seen{$_}
> >
> > Tries to lookup the line in the hash of lines we've already seen.
> >
> > $seen{$_}++
> >
> > This is a complete guess, I c
>It is beautiful, but I fear it could scare a beginner away. I'd rather
>such brilliance were directed to the Fun With Perl list than exposed to
>people many of whom are no doubt still wondering whether Perl is a
>write-only language.
>Which might be a cue for Tim Maher to pipe up and talk ab
Alex,
In article <[EMAIL PROTECTED]>, Alex Stan wrote:
>I need to search for a string in httpd.conf file , ( the string is :
>CustomLog /var/log/httpd/site.com/access_log ) and then replace
>inside them site.com with site_com. I mentioned that the site.com can take
>diferent values, such as shop
> -Original Message-
> From: alex stan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 1:57 PM
> To: [EMAIL PROTECTED]
> Subject: search for string in a file
>
>
> I need to search for a string in httpd.conf file , ( the
> string is : CustomLog /var/log/httpd/site.com/access_l
At 08:57 PM 7/30/01 +0300, alex stan wrote:
>I need to search for a string in httpd.conf file , ( the string is :
>CustomLog /var/log/httpd/site.com/access_log ) and then replace
>inside them site.com with site_com. I mentioned that the site.com can take
>diferent values, such as shop.com ,
>
--- David Blevins <[EMAIL PROTECTED]> wrote:
> > perl -nle 'print if !$seen{$_}++'
>
> The dash n (-n) puts the command 'print if !$seen{$_}++' in a while
> (<>) { ... } loop. So we get:
>
> while (<>) {
> print if !$seen{$_}++
> }
>
> $seen{$_}
>
> Tries to lookup the line in the hash
At 12:56 PM 7/30/01 -0500, David Simcik wrote:
>Hey folks,
> I'm about to embark on some serious beginner date manipulation
> and I was
>wondering if anybody had ANY pointers about handling dates. I'm specifically
>interested in working with the different date formats DD/MM/,
>MM/DD/
At 12:21 PM 7/30/01 -0700, I wrote:
>It is beautiful, but I fear it could scare a beginner away. I'd rather
>such brilliance were directed to the Fun With Perl list than exposed to
>people many of whom are no doubt still wondering whether Perl is a
>write-only language.
Harrumph, I wasn't cau
--- Bob Bondi <[EMAIL PROTECTED]> wrote:
> I had wanted to keep all the declarations in a section and the subs
> in a section and the main script at the bottom, but, I find I must
add
> code in the declaration section!
I like to keep "sections" too, though the parser doesn't care so much.
Try th
Yikes! This is what I was talking about. Amazing.
Let me take a crack at the first one -- should be entertaining for everyone
;)
From: Jeff 'japhy/Marillion' Pinyan
>
> Here's a one-liner:
>
> perl -nle 'print if !$seen{$_}++'
The dash n (-n) puts the command 'print if !$seen{$_}++' in a wh
At 02:47 PM 7/30/01 -0400, Jeff 'japhy/Marillion' Pinyan wrote:
>On Jul 30, Paul said:
>
> >--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote:
> >> perl -pe '$_ x= !$seen{$_}++' (attributed to some of Larry's genius)
> >
> >LOL!!! Twistedly brilliant!
> >
> >Ok, lemme see if I can parse
I've been trying to figure out how to give help with a -h opt flag and use
the Getopt::Std within the same script.
I've tried several ways to make this happen, and stumbled on an answer.
I've discovered that use Getopt::Std will not allow me to use @ARGV beyond
the point I have typed Getopt::Std
> >--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote:
> >> perl -pe '$_ x= !$seen{$_}++'
> >>(attributed to some of Larry's genius)
> >
> >LOL!!! Twistedly brilliant!
> >
> >Ok, lemme see if I can parse this.
> [correct prognosis snipped]
> >Is that right?
>
> Yes. I attribut
On Jul 30, Paul said:
>--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote:
>> perl -pe '$_ x= !$seen{$_}++' (attributed to some of Larry's genius)
>
>LOL!!! Twistedly brilliant!
>
>Ok, lemme see if I can parse this.
[correct prognosis snipped]
>Is that right?
Yes. I attribute that
--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote:
> perl -pe '$_ x= !$seen{$_}++' (attributed to some of Larry's genius)
LOL!!! Twistedly brilliant!
Ok, lemme see if I can parse this.
perl -pe says print each line after the -e code has been executed.
"$_ x= !$seen{$_}++" say
On Mon, Jul 30, 2001 at 08:02:58PM +0200, Matija Papec wrote:
> ok, to simplify let's suppose that
>
> @datumi2 = (1, 2, 3);
>
> #so final result should look like this:
> @data[0] = ("", "", "");
> #and
> @data[1] = (1, 2, 3);
This notation is almost certainly incorrect, what you probably meant
--- Robb Wagoner <[EMAIL PROTECTED]> wrote:
> I have a two dimensional array where each element consists of a
> reference to an anonymous array.
>
> push(@array,[$var1,$var2,$var3]);
That's pretty much the way all multidimensional arrays (and hashes)
work in Perl.
> When I pass a referen
On Sun, Jul 29, 2001 at 09:10:03AM -0400, bc wrote:
> couldn't find diagnostic data in
> /usr/local/lib/perl5/5.6.0/pods/perldiag.pod
> /usr/local/lib/perl5/5.6.0/i686-linux /usr/local/lib/perl5/5.6.0
> /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
> /usr/local/lib/perl5/site_perl/5.6.0 /usr/loc
On Jul 30, Paul said:
>> while (){
>>if (not $seen{$_}) {
>>$seen{$_} = 1;
>> print OUTFILE;
>> }
>> else {
>> }
>> }
Here's a one-liner:
perl -nle 'print if !$seen{$_}++'
and here's another:
perl -pe '$_ x= !$seen{$_}++' (attributed to some of Larry's g
I overwrote it with what 'worked'. :-)
I will try to recreate.
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 11:15 AM
To: Robb Wagoner
Cc: [EMAIL PROTECTED]
Subject: RE: reference to a two dimensional array
On Mon, 30 Jul 2001, Robb Wago
On Mon, Jul 30, 2001 at 10:36:50AM -0700, Matt Lyon wrote:
> here's one for the group... is there a module ala getopt::long that will do
> the arg-getting as well as command-line completion with a predefined
> list/hash/etc... of keywords?
Command line completion is done by a shell rather than an
--- Carl Rogers <[EMAIL PROTECTED]> wrote:
> One word of caution it looks to me like this will catch
> duplicates lines, just as long as the duplicate lines follow each
> other. . . .
I posted a one-liner that does the same as the code below. =o)
>
> while (){
>if (not $seen{$_}) {
>
On Mon, 30 Jul 2001, Robb Wagoner wrote:
> That's what I thought but I couldn't seem to get it to work. I am going to
> go try it again. I am betting I had a typo somewhere when I what seemed to
> be the proper way.
> I DO read the warnings and errors and look at what line number the parser
> puk
That's what I thought but I couldn't seem to get it to work. I am going to
go try it again. I am betting I had a typo somewhere when I what seemed to
be the proper way.
I DO read the warnings and errors and look at what line number the parser
pukes on. . .
Thanks Brett.
Robb
-Original Me
John Edwards <[EMAIL PROTECTED]> wrote:
>Can you explain what your trying to achieve??
>
>You want an array called @data which consists of all the elements from
>@dataumi2? Where does the second array with empty element values come from,
>why is it needed?
ok, to simplify let's suppose that
@dat
On Mon, 30 Jul 2001, Robb Wagoner wrote:
> I have a two dimensional array where each element consists of a reference to
> an anonymous array.
>
> push(@array,[$var1,$var2,$var3]);
>
> When I pass a reference to the array in a subroutine:
>
> some_sub(\@array);
>
> What is the proper w
I need to search for a string in httpd.conf file , ( the string is :
CustomLog /var/log/httpd/site.com/access_log ) and then replace
inside them site.com with site_com. I mentioned that the site.com can take
diferent values, such as shop.com ,
radioq.
On Jul 30, Robb Wagoner said:
>When I pass a reference to the array in a subroutine:
>
> some_sub(\@array);
>
>What is the proper way to dereference the array with in the subroutine?
I do:
some_sub([ [1,2,3], [4,5,6] ]);
sub some_sub {
my $aref = shift;
print $aref->[0][0];
One word of caution it looks to me like this will catch duplicates
lines, just as long as the duplicate lines follow each other. You may want
to do some kind of a sort process prior to running this line of code.
Only reason I bring this up... I've been bitten by this same problem in the
pas
I have a two dimensional array where each element consists of a reference to
an anonymous array.
push(@array,[$var1,$var2,$var3]);
When I pass a reference to the array in a subroutine:
some_sub(\@array);
What is the proper way to dereference the array with in the subroutine?
A
--- David Blevins <[EMAIL PROTECTED]> wrote:
> Here is a one-liner I just wrote to delete duplicate lines in a file.
>
> perl -ni.bak -e 'unless ($last eq $_){print $_};$last=$_;' theFile
That requires that it be sorted, doesn't it?
> Going with the TMTOWTDI credo, I was just curious if anyone
here's one for the group... is there a module ala getopt::long that will do
the arg-getting as well as command-line completion with a predefined
list/hash/etc... of keywords?
-mL
-- Life would be so much easier if its source code was well-commented.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Here is a one-liner I just wrote to delete duplicate lines in a file.
perl -ni.bak -e 'unless ($last eq $_){print $_};$last=$_;' theFile
Going with the TMTOWTDI credo, I was just curious if anyone knew of a better
way.
Thanks,
David
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Dose anyone know of a exsiting Perl module that will test to see what tape drives are
available on Unix box?
I looked through the some of the CPAN stuff but didn't find anything that looked like
what I might need.
Any help would be appreciated.
Thank you,
Anna
--
To unsubscribe, e-mail:
Yes -- i see now that i'm going about this whole thing the wrong way. I'm
trying to make the module do too much. It's a bad habit i'm trying to
break.
I suppose if the luser who uses my package doesn't like what 'bark' does
s/he will just have to overload it themselves. ;)
Interestingly enoug
Hey folks,
I'm about to embark on some serious beginner date manipulation and I was
wondering if anybody had ANY pointers about handling dates. I'm specifically
interested in working with the different date formats DD/MM/,
MM/DD/, Dec 12 2000, etc. etc. What about working with the
File::Copy does the opening/closing of files for you. You might be messing
things up by doing an open/close around the copy operation (though I can't
see why myself). Try just:
--
#!/usr/bin/perl -w
use strict;
use File::Copy;
copy("temp.htm", "lmi/aol.htm");
I need to search for a string in httpd.conf file , ( the string is :
CustomLog /var/log/httpd/site.com/access_log ) and then replace
inside them site.com with site_com. I mentioned that the site.com can take
diferent values, such as shop.com ,
radioq.
On Monday 30 July 2001 12:05, Matija Papec wrote:
> Program below works fine but I wander how to optimize this; it looks very
> ugly. The final result have to be @data which contains two arrays. First
> array have to be equal size of second array(@datumi2) and all their values
> have to be "".
Hm
Lightning flashed, thunder crashed and alex stan <[EMAIL PROTECTED]> whispered:
| Could anyone help me?
| How can i find a string in a file and then replace it with another string?
| Thanks a lot
Try:
perl -i.bak -pe 's/oldstring/newstring/g' filename
This will create a backup of the original f
On Jul 30, Matija Papec said:
>my $i;
>my (@datumi2) = (1..100);
>my (@temp, @data);
>
># block for optimization
>
>for $i (0..$#datumi2) { push @temp, "" }
>push @data, \@temp;
>undef @temp;
>
># end of block for optimization
>
>push @data, \@datumi2;
You can use the length of an array with the
Can you explain what your trying to achieve??
You want an array called @data which consists of all the elements from
@dataumi2? Where does the second array with empty element values come from,
why is it needed?
to assign @data with all the elements from @dataumi2 do this
@data = @dataumi2;
---
Lightning flashed, thunder crashed and "Sascha Kersken" <[EMAIL PROTECTED]> w
hispered:
| DIR = opendir ("path/to/dir");
I think you mean 'opendir(DIR, "/path/to/dir");' not
'DIR = opendir("/path/to/dir");'.
-spp
--
Stephen P Potter [EMAIL PROTECTED]
"Y
On Jul 30, David Wood said:
>$str = qq(
>
> some data
> some more data
>
>);
>
>What I need to do is something like:-
>
>$str =~ s/]+\n(.*?)<\/udb:$1>/$sub->($1,$2)/gs;
Even if you change the $1 to a \1, it won't match, since you have
]+\n
when you need
]+>\n
--
Jeff "japhy" Pinyan
Program below works fine but I wander how to optimize this; it looks very
ugly. The final result have to be @data which contains two arrays. First
array have to be equal size of second array(@datumi2) and all their values
have to be "".
--
my $i;
my (@datumi2) = (1..100);
my
Lightning flashed, thunder crashed and Peter Scott <[EMAIL PROTECTED]> whispered:
| Yes, but if you create the above using something like
|
| open (MAIL, "|/usr/sbin/sendmail $email")
|
| to which you should by the way add
|
| or die "sendmail: $!\n";
This probably does not d
Try $dbh -> disconnect;
Cheers
Mark C
> -Original Message-
> From: Frank Newland [mailto:[EMAIL PROTECTED]]
> Sent: 30 July 2001 16:35
> To: [EMAIL PROTECTED]
> Subject: Destroying Database Handle
>
>
> Question about DBI
>
> I'm having success in preparing , executing and getting SQ
At 08:35 AM 7/30/2001 -0700, ERIC Lawson - x52010 wrote:
>What's the most efficient way to find the total number of lines in a file
>using perl?
Type
perldoc -q lines
Peter Scott
[EMAIL PROTECTED]
http://www.perldebugged.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
> -Original Message-
> From: Frank Newland [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 11:35 AM
> To: [EMAIL PROTECTED]
> Subject: Destroying Database Handle
>
>
> Question about DBI
>
> I'm having success in preparing , executing and getting SQL
> output when I use DBI.
> -Original Message-
> From: ERIC Lawson - x52010 [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 11:35 AM
> To: [EMAIL PROTECTED]
> Subject: most efficient way to count lines in a file
>
>
> What's the most efficient way to find the total number of
> lines in a file using per
> -Original Message-
> From: mark crowe (JIC) [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 11:25 AM
> To: beginners
> Subject: eval and Data::Dumper
>
>
> Please can someone give me some advice about Data::Dumper. I
> have a program which will generate a large multidimensio
Question about DBI
I'm having success in preparing , executing and getting SQL output when I
use DBI.
What I want to do is ensure that I close properly.
Q: What statement(s) do I need to prevent destroying database handle?
Thanks,
Frank
***
#!/usr/bin/perl -w
use stric
What's the most efficient way to find the total number of lines in a file
using perl?
Now, I'm using
while () { ++$lincnt; }
thanks,
Eric Lawson
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Please can someone give me some advice about Data::Dumper. I have a program
which will generate a large multidimensional array which I then want to
import into another program. From what I remember from some posts a while
ago (and can't find again now) I should be able to do this using
Data::Dumpe
At 04:40 PM 7/30/2001 +0100, David Wood wrote:
>What I need to do is something like:-
>
>$str =~ s/]+\n(.*?)<\/udb:$1>/$sub->($1,$2)/gs;
>
>But putting the $1 on the LHS is not valid...
In the regex itself, use \1, \2, etc instead of $1, $2, etc (which would
match their values, if any, from the
Heylp,
Don't know how this is possible, but I need to match text within a file
(over newlines) that looks like:-
$str = qq(
some data
some more data
some data
some more data
some data different to the first person
some more different data
);
What I need to do is something
Hi!
I want to copy "temp.htm" to "aol.htm"
Why doesn't this code work ?
#!/usr/bin/perl -w
open(TEMP, "+>temp.htm");
open(FICHIER,">lmi/aol.htm");
use File::Copy;
copy("temp.htm","lmi/aol.htm") ;
close FICHIER;
close TEMP;
Thanks
Franck
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
I have a dynamic CGI.pm generated form which changes
based upon the contents of hidden fields. Inside my
form are several "internal submission" buttons, as
well as a "final submission" button. My form is very
long, but I don't want to make it a multipart form. I
would like to know if there is a wa
I sometimes use a spacer instead of It's just a blank image.
Regards, Gia.
Rahul Garg wrote:
> Hello,
>
> In my perl script , i am writing HTML code..within it i am using for
>spaces , as i need a lot spaces is there any other solution.
>
> Thanx in advance,
> Rahul Garg.
At 01:09 PM 7/30/2001 +0530, Narendran Kumaraguru Nathan wrote:
>Hai all,
>I have a local array and I wish to delete the last element of the
> array from the
>subroutine. I pass the array as reference and tried as
>pop(@array_neme);
>this didn't work. Is there a way I can do it?
First, by pa
Hi,
I'm not sure you're quite understanding the logic of modules and packages
yet...
the idea of a module is that you use methods (subroutines belonging to a
package) to execute code
however, you're making your 'methods' attributes to an object.
This quite defeats the purpose and provides nothing
On Mon, 30 Jul 2001, Mooney Christophe-CMOONEY1 wrote:
> Saying
> $a_dog->{'speak'}($a_dog)
> on the last line would solve this problem, but it would be nice not to have
> to worry about passing itself to the function. Does anyone see any
> alternatives to this?
>
> Thanks!
>
> #!/local/pe
Hello, all -- i have come across an interesting problem. When i run the
following script, i get that '$this' in dog::bark is undefined. When i
think about it, this makes sense, since call $a_dog->{'speak'}() is like
saying "dog::bark".
Saying
$a_dog->{'speak'}($a_dog)
on the last line w
Sorry. Just had an error pointed out. Remove the i, not the g from the line
for case sensitity. Not thinking straight...
g is for global matches, so if your search string appears more than once on
each line of your input file, all instances will be converted to your
replacement string. If the g i
> Note, it's case insensitive, if you don't want that, remove the g from
> s/$lookfor/$replacewith/ig;
If you want it case sensitive, remove the "i" not the "g". The i designates
ignore case. :-)
--
Life would be so much easier if we could just look at the source code.
--
To unsubscribe,
$lookfor = "string";
$replacewith = "newstring";
open IN, "input.txt" or die "Can't open input.txt: $!";
open OUT, ">output.txt" or die "Can't create output.txt";
while () {
s/$lookfor/$replacewith/ig;
print OUT;
}
close OUT;
close IN;
output.txt should now have all instances o
Hi,
Maybe your server thinks it's a document? Possible causes:
1. You've used the wrong extension on your script. Some require the extension
to be '.cgi'.
2. Your script isn't in the correct cgi directory, which is usually /cgi-bin.
Hope this helps,
Francis
Prachi Shroff wrote:
> Hi,
>
> I
Could anyone help me?
How can i find a string in a file and then replace it with another string?
Thanks a lot
---
ROL!RO free mail - http://mail.rol.ro
Spatiu nelimitat pentru contul tau si acces gratuit prin dial-up!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-
Hi,
I have a perl script and designed a simple web page for its front
end...but this package is running on a single machine and not connected
to any server. when the form on the HTML page is submitted, it should run
the perl script specified in the ACTION field of the form. Now, the proble
to count the listing you could try
$number = `ls /path/to/directory|wc -l`;
tmtowtdi?
terry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Mon, 30 Jul 2001, debashis rana (JIC) wrote:
> I made a HTML document using HTML-kit and I tidied it up with XHTML. When I
> run that HTML in Apache in Windows ME I got many compilation errors. When I
> run the same HTML in Internet Explorer I dont get any error. It works fine.
> I was wonde
> Peter Scott <[EMAIL PROTECTED]> said:
> Yes, but if you create the above using something like
>
> open (MAIL, "|/usr/sbin/sendmail $email")
>
> to which you should by the way add
>
> or die "sendmail: $!\n";
I left the "die" off for brevity. Good point.
> then you now ne
> -Original Message-
> From: Narendran Kumaraguru Nathan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 6:08 AM
> To: [EMAIL PROTECTED]
> Subject: [Fwd: Re: how can an element in a array be deleted
> from a subroutine ?]
>
>
>
> Hai all,
>I have found it myself, using sp
Hi
I made a HTML document using HTML-kit and I tidied it up with XHTML. When I
run that HTML in Apache in Windows ME I got many compilation errors. When I
run the same HTML in Internet Explorer I dont get any error. It works fine.
I was wondering if there is anything I need to do configure Apac
Hi!
I have a problem with that code:
#!/usr/bin/perl -w
use File::Copy;
opendir (LMI,"lmi") || die "impossible d'ouvrir lmi: $!";
$chaine='BEGIN PAPIER';
while($fichier=readdir LMI)
{
next if ($fichier eq '.' or $fichier eq '..');
open (FICHIER,"lmi/$fichier") || die "impossi
Hi
Suppose you just wanted to do files i.e. excluding directories?
Mazza
> -Original Message-
> From: Sascha Kersken [mailto:[EMAIL PROTECTED]]
> Sent: 30 July 2001 12:47
> To: COLLINEAU Franck FTRD/DMI/TAM
> Cc: [EMAIL PROTECTED]
> Subject: Re: counting files of a directory
>
>
> Hi!
On Mon, 30 Jul 2001, Rahul Garg wrote:
> In my perl script , i am writing HTML code..within it i am using
> for spaces , as i need a lot spaces is there any other
> solution.
You still need to use to make spaces. However, the easy way to
create an arbitrary number of spaces
You can do it in this way
opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
@dots = readdir(DIR);
closedir DIR;
$num = @dots; # num contains all types of files (directory files, link
files, ...)
opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
@dots = grep { -f "$some_
Hello,
Did you know about the 'x' operator?
print ' ' x 50; # this will print 50 times.
Hope this helps,,,
Aziz,,,
In article <001c01c118dc$3926cb40$1900a8c0@shakti>, "Rahul Garg"
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> In my perl script , i am writing HTML code..within it i am using
Hello,
Try the glob function, or the <*> glob:
my $count = () = glob("/path/to/dir/*");
or
my $count = () = ;
Hope this helps,,,
Aziz,,,
In article
<[EMAIL PROTECTED]>,
"COLLINEAU" <[EMAIL PROTECTED]> wrote:
> Hello!
>
> Is there a function which count the number of files in a directory ?
Hi!
I'm not aware of a FUNCTION to do it, but this should work:
DIR = opendir ("path/to/dir");
$count = 0;
while (readdir DIR)
{
$count++;
}
- afterwards, $count's value is the number of directory entries.
Sascha
--
>Von: COLLINEAU Franck FTRD/DMI/TAM <[EMAIL PROTECTED
Hello!
Is there a function which count the number of files in a directory ?
Thanks
Franck
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
1 - 100 of 105 matches
Mail list logo