- Original Message -
From: "Ahmed Moustafa" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: "Leon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
> Can you open a file for reading and writing as the same time?
I have asked the question of can I read and write to the same file
simultaneou
What if you try this
%perl filename.pl
If this runs then it just means that your path_to_perl is wrong on your
shebang line.
Happy New Year all!!
-Original Message-
From: John Gilger [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 6:27 PM
To: [EMAIL PROTECTED]
Subject: perl o
- Original Message -
From: "Peter Lemus" <[EMAIL PROTECTED]>
> Hi I need to add a word to the end of a word inside a
> file.
>
> HELP PLEASE
>
> for example: I will read a file with these names
> july
> tony
> richard
>
> then I want to add the following to the name
> @minime.com. So it
I am not sure whether this is a perl question or a Mac question, but I
haven't found a good OSX list yet so please bear with me. I have tried to
find the answer in "Learning Perl", "Programming Perl", and the
"Perl Cookbook" without success.
I write the scripts exactly the same as I do on a Li
Assume that $file is the names file that you have.
!/usr/bin/perl -w
$file = qq(./file);
$newfile = qq(./newfile);
open FILE, "$file" or die "Cannot open file $file: $!\n";
open INFILE, ">$newfile" or die "Cannot open file $newfile: $!\n";
while () {
chomp($_);
s/(.*)/$1\@feathertrip\.net
Peter Lemus wrote:
>
> Hi I need to add a word to the end of a word inside a
> file.
>
> for example: I will read a file with these names
> july
> tony
> richard
>
> then I want to add the following to the name
> @minime.com. So it will look like [EMAIL PROTECTED]
perl -pli -e's/$/\@minime.
Wow! Your question sounds really urgent. Did you get talked into converting
a contact database into a bulk email sender? I hate when that happens.
Whether or not that's what you're doing, this should help:
$email = $name . '@minime.com'; # i'm pretty sure this works
Look up the '.' (dot) ope
Before I point to the problem here, let me point out that you are trying
to use symbolic references which will severely decrease the readability
of your code.
I personally believe that symbolic references are one of the many forms
of evil perl which, while appearing elegant, merely lure you
Cool...
http://www.rexswain.com/httpview.html
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi I need to add a word to the end of a word inside a
file.
HELP PLEASE
for example: I will read a file with these names
july
tony
richard
then I want to add the following to the name
@minime.com. So it will look like [EMAIL PROTECTED]
=
Peter Lemus
UNIX/NT Networks Engineer
[EMAIL PROTE
Well I'm not sure why you would want to do it that way, but it can be
done...
${$arrayname}{$columns[0]} = $columns[1];
You may be better off with an array of hashes...
my @data = ();
while( my @columns = $cursor->fetchrow ) {
my %tmp = ()
$tmp{$columns[0]} = $columns[1];
push @data, \%tm
an alternative might be a beginners tutorial to OO programming in perl that i
wrote...
check it out here:
http://www.japh.nu/index.cgi?base=tuts
hth, jos
Quoting Peter Cornelius <[EMAIL PROTECTED]>:
> There's some great documentation on this. Check out 'perldoc perltoot'
> on
> your local c
I am trying to build up associative arrays using a looping draw from a database. I
would like to end up with one or more arrays(depending on number of elements in the
@Dataset) named %sub0, %sub1, %sub2... and so on. I need to keep these arrays around
for latter manipulation.
What I have now
Hi friends.
I am looking for a module to make a phone call, please tell me if you know
one.
Bye and Thanks a lot.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I'm not sure that I completely understand, so this may or may not help.
Anyway, I hope it does.
If I understand correctly you want to grab each section and pass it to the
appropriate sub for processing. There are lots of ways to do this, but this
way came to mind first. It all works around
Hello - I am trying to figure out how to convert an output file to a comma
separated values file.
The original file is of this form:
* foo ***
thingA: 12
thingB: 23
thingC: 21
Thanks for all your help.
--- Michael McQuarrie <[EMAIL PROTECTED]> wrote:
> I'm sure this is a dumb question. It seems like one anyways. Is there a move
>command in perl?
> I
> know I can copy then unlink a file but I cant find a move (or similar) command.
>
> -Michael
>
>
The File::Copy module provides two basic functions, copy and move, which are
useful for getting the contents of a file from one place to another.
- Original Message -
From: "Michael McQuarrie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 31, 2001 3:51 PM
Subject: mo
yes
will work in win32 as well. I guess 'rename' would be better, avoids usig
shell function call.
> -Original Message-
> From: McCollum, Frank [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 31, 2001 11:03 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: R
I think 'system("mv", "/dir/file", "/dir2/file");', will only work if you
have access to unix functions.
system("mv", "/dir/file", "/dir2/file");
> -Original Message-
> From: Michael McQuarrie [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 31, 2001 10:51 AM
> To: [EMAIL PROTECTED]
system("mv", "/dir/file", "/dir2/file");
> -Original Message-
> From: Michael McQuarrie [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 31, 2001 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: move
>
>
> I'm sure this is a dumb question. It seems like one anyways.
> Is there a move c
I think the rename function is what you're looking for:
rename "old", "new";
-Original Message-
From: Michael McQuarrie [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 10:51 AM
To: [EMAIL PROTECTED]
Subject: move
I'm sure this is a dumb question. It seems like one anyways.
I'm sure this is a dumb question. It seems like one anyways. Is there a move command
in perl? I
know I can copy then unlink a file but I cant find a move (or similar) command.
-Michael
__
Do You Yahoo!?
Send your FREE holiday greetings online!
I am developing a script that is being used in a data
warehousing environment on an NT server. I am logging
the script's activity (log & err) in files under a
folder specific to each multidimensional cube that is
processed. Multiple instances of this script can be
running concurrently because I pr
cant control it ...
my company appends it to all messages sent from the company
sorry
-Original Message-
From: Andrea Holstein [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 29, 2001 9:01 AM
To: [EMAIL PROTECTED]
Subject: Re: child processes and environment variables
Thomas Macie
Hello Richard,
Monday, December 31, 2001, Richard S. Crawford <[EMAIL PROTECTED]> wrote:
RSC> Here's the problem. When I run Perl scripts under win2k, I have to include
RSC> this as the first line of each CGI script:
RSC> #! c:/perl/bin/Perl.exe
RSC> But when I run them under Linux,
Dale W wrote:
>
> If I run the script from my browser, it works great. When I call the CGI
> file from my SHTML file, it just dumps all of the text from the CGI file
> into the brower. Here is a simple example:
>
> -MY.SHTML
>
I don't know something about "virtual" scripts.
However,
>
A related term of pretty much the same parentage is SNAFU
Situation Normal All Fouled Up
I am pretty sure both terms originated during WWII.
-Original Message-
From: Matt C. [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 30, 2001 7:22 PM
To: [EMAIL PROTECTED]
Subject: Re: Would any
Nestor Florez wrote:
>
> From: "John W. Krahn" <[EMAIL PROTECTED]>
>
> > Birgit Kellner wrote:
> > >
> > > while ($string =~ /(<[^>]*?)"/gs) {
> > > my $var = $1;
> > > $string =~ s/$var"/$var'/;}
> > >
> > > print qq|$string\n|;
> >
> > $string =~ s/(<[^>]+>)/$a=$1;$a=~tr|"|'|;$
If I run the script from my browser, it works great. When I call the CGI
file from my SHTML file, it just dumps all of the text from the CGI file
into the brower. Here is a simple example:
-MY.SHTML
-MY.CGI
#!/usr/bin/perl
print "content-type:text/html\n\n";
print "This is BOLD";
pr
John,
can you explain the piece of code that you wrote.
Thanks and happy new year :-)
- Original Message -
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 30, 2001 3:38 AM
Subject: Re: regexp to replace double with single quotes inside html tags
31 matches
Mail list logo