If I want the following field to contain forwarded slashes - this is for a linux box,
as follows.
$dir=//ITC/home/techs;
How do I get the forward slashes in there?
I have tried:
$dir ='//ITC';
$dir ='//ITC';
$dir =`//ITC`;
Nothing works. Help.
Thank you - Susan
--
To unsubscribe,
Susan,
Since everything you wrote only contains forward slashes ('/'), I am
a bit confused as to what you are trying to do. Are you trying to
convert the forward slashes to back slashes ('\')?
$dir =~ s!//!\\!g;
Please clarify what you are trying to do:(
Kristofer
--- Susan Aurand
On 6/25/03 at 10:32 AM, [EMAIL PROTECTED] (Susan Aurand) wrote:
If I want the following field to contain forwarded slashes - this is
for a
linux box, as follows.
$dir=//ITC/home/techs;
How do I get the forward slashes in there?
I have tried:
$dir ='//ITC';
$dir ='//ITC';
$dir
All,
I am new to Perl, and as such has only started to look at some simple commands, such
as a guestbook email document.
When on on page, I ask the user to complete an email field, when the email is
received, the email address is changed to say :-
[EMAIL PROTECTED]
instead of [EMAIL
What do I need to do in order to use a filehandle that was opened earlier in
a program within a subroutine? I've included an example of the code I have
that is not doing what I would like. Basically, I never get any output to
the file. If I change it so that it doesn't use the subroutine when
It is supose this code prints the first line of file text.txt (which is
not empty), but it doesn't print anything.
$file = text.txt;
open (file);
file;
print;
close (file);
I understood that file; gets a line (the first in this case) and, in
this case, it puts the line in $_ . Also, print;
That's because when you read from the file handle using the brackets, it
doesn't automatically put the line into $_. You're just throwing away the
result. print() does print $_, but in this case there's nothing in it.
BTW, my personal advice would be to avoid the implied $_ magick until you
Chris San wrote:
It is supose this code prints the first line of file text.txt (which
is not empty), but it doesn't print anything.
$file = text.txt;
open (file);
file;
The above statement does not store the result in $_, this is special
only inside a while statement
while (file) is
Thanks, that worked perfectly.
Regards
Peter Goggin
- Original Message -
From: Bakken, Luke [EMAIL PROTECTED]
To: Peter Goggin [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:06 AM
Subject: RE: Use of Perl for global changes
cd /whatever dir
perl -i.bak
Did open ever succeeded??
Check with:
open(FILE,$logfile) or die $!;
-sharad
-Original Message-
From: Scott, Joshua [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 11:13 PM
To: [EMAIL PROTECTED]
Subject: File Handles in subroutines
What do I need to do in order to use
Scott, Joshua wrote:
What do I need to do in order to use a filehandle that was opened earlier in
a program within a subroutine? I've included an example of the code I have
that is not doing what I would like. Basically, I never get any output to
the file. If I change it so that it doesn't use
It's funny how as soon as you learn/meet/hear/read
something/someone/something you see/hear it/him/her everywhere.
I saw this last night in an article by R. Schwartz and then this morning
again somewhere else. Problem being - how to count to N and then start over
(counting on your fingers, for
Hi All!
I have the following trouble:
I have an script in which several code lines must be executed so if one of these lines
is not executed the other lines must neither be executed, and I would like to know if
perl has something like asp transactions to force the execution of several code
Hi,
I have the script below which outputs some values in a tabular form into
the body of a mail. I'm using the format utility in PERL to output the
values in a tabular form as in:
PROG NO VERSION PROTOCOLPORTSERVICE RESPONSE
Hi gurus,
I have a script that is causing me some trouble. I haven't pasted the whole script
here
as it is a bit long and I can't submit any test data.
Basically the script copies and renames file. At the end I would like to print out a
report of all the files it has renamed. These reports
hi, i wrote this little program. it shows a directory structure using
tree and hlist. it reads the directoycontent from a file. when i
display small directories, the program starts fast, but as soon as the
directory is big, it takes a long time to start. for example when i use
the /var directory.
Does anybody know how to redirect from a perl page with a print Content-type:
text/html\r\n\r\n; code line?
Thank you very much.
Miguel Angel
*
Madrid 2003 Global IPv6 Summit
Presentations and videos on-line at:
http://www.ipv6-es.com
Yes,
Have a look to this :
http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2002/sld050.htm
HTH,
José.
-Original Message-
From: Miguel Angel Morales [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 11:25 AM
To: [EMAIL PROTECTED]
Subject: transactions in perl
Hi All!
I have
OK, please keep it simple...
Where can I find an introduction on using Perl to access an MSSQL database?
Cheers,
Dave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi! I'm still wallowing in Chapter 3 (Arrays. Why can't I get it?!?!?!? ARGH!) of
Learning Perl on Win32 Systems. I'm trying to create an exercise but I'm not getting
the results that I want. Here's what I'm trying to do:
I'm asking for a list of names:
print Name your friends: ;
@names
Any advice on getting through the LP/Win 32 book? I know I can do it but I'm getting
tripped up. I've moved on to other chapters and I'm about to read Chapter 7 but I
still haven't gotten arrays and hashes. My study routine consists of reading and
taking notes; studying the notes; going through
What do I need to do in order to use a filehandle that was
opened earlier in
a program within a subroutine? I've included an example of
the code I have
that is not doing what I would like. Basically, I never get
any output to
the file. If I change it so that it doesn't use the
Put the book down. Go and buy learning perl from oriely. You can whip
through this book in a day or two and it will lay down all of the ground
work for you. Plus it is setup with exercise at the end of every
chapter.
Then after you finish the book make up a project and try to apply
everything you
Hi Anthony,
grabbed this from O'Reilly's Learning Perl :
@rocks = qw/ bedrock slate lava /;
foreach $rock (@rocks) {
$rock = \t$rock; # put a tab in front of each element of
@rocks
$rock .= \n; # put a newline on the end of each
}
print The rocks are:\n, @rocks;
I'm on NT and I got it because it was the NT version of Learning Perl. I think it's
the same book but edited for NT users. And it's the exercises that are killing me!! I
feel that I've got but then when I do an exercise BAM! Wrong answer! I think I'm just
getting a little frustrated but I KNOW
Any advice on getting through the LP/Win 32 book? I know I
can do it but I'm getting tripped up. I've moved on to other
chapters and I'm about to read Chapter 7 but I still haven't
gotten arrays and hashes. My study routine consists of
reading and taking notes; studying the notes; going
Could I be putting too much stock into the exercises? That's where I'm getting
frustrated. For example, I'm treating them as test exercises and when I don't get
them correct, I deem the chapter a failure, which is silly since there are 2 or 3
questions per chapter. Maybe I should treat them as
What kind of error messages are you getting.
Running Win2k over here.
Can you give an example of a script which doesn't work?
-Original Message-
From: Anthony Beaman [mailto:[EMAIL PROTECTED]
Sent: 25 June 2003 13:46
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: Mastering Learning Perl
Does anybody know how to redirect from a perl page with a
print Content-type: text/html\r\n\r\n; code line?
are you trying to redirect a client to another web site or page?
you can try a google search for redirect web page and get tons of info
you can use a cgi script like below:
use
Give us some examples.
-Original Message-
From: Anthony Beaman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 8:46 AM
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: Mastering Learning Perl on Win 32 Systems
Could I be putting too much stock into the exercises? That's where
Mostly the exercises for the chapters on Arrays and Hashes. Hashes killed me! I didn't
get any right! It's getting better because I've re-read the chapter and studied my
notes again and I actually feel better about it. Sorry for this post! I guess I was
venting or something. Ah...I feel much
Post the exercise and the code you tried. we will help you
-Original Message-
From: Anthony Beaman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 8:55 AM
To: [EMAIL PROTECTED]; Kipp, James; [EMAIL PROTECTED]
Subject: RE: Mastering Learning Perl on Win 32 Systems
Mostly
Glad you figured it out.
For future reference try and post an example of something you are having
trouble with.
Being vague likes this makes it impossible to help you.
This list is an awesome resource.
Have a problem and 9 out of 10 times you not only have a solution but
you have an
Thanks! I apologize for using this list as a form of therapy (venting over the
frustrations of not getting an answer right). :-)
You're right! This IS an awesome resource!! I'll be more specific next time.
-Original Message-
From: Paul Kraus
Hi Anthony
Anthony Beaman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi! I'm still wallowing in Chapter 3 (Arrays. Why can't I get it?!?!?!?
ARGH!) of Learning Perl on Win32 Systems. I'm trying to create an
exercise but I'm not getting the results that I want. Here's what I'm
Anthony Beaman said:
Hi! I'm still wallowing in Chapter 3 (Arrays. Why can't I get it?!?!?!?
ARGH!) of Learning Perl on Win32 Systems. I'm trying to create an
exercise but I'm not getting the results that I want. Here's what I'm
trying to do:
I'm asking for a list of names:
print
Hi! I'm on Windows 98 at the moment (at work) but I'll try this on my NT machine when
I get home. Here's what I got when I ran your script:
C:\perl hello.pl
Joe Mary Sue
Use of uninitialized value in concatenation (.) at hello.pl line 5, STDIN line
1.
I know .
Got an error but then I got the
I typed in 3. For example, Sam Mary Joe. I expect to get I know Mary, since she's
[1] but I'm getting a blank space. I've tried this on NT and on my 98 machine here at
work.
-Original Message-
From: Paul Johnson [mailto:[EMAIL PROTECTED]
OK, please keep it simple...
Where can I find an introduction on using Perl to access an
MSSQL database?
perldoc DBI
http://search.cpan.org
Yu use DBI to connect to the DB then do sql and such with it
Cheers,
Dave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Hi Anthony,
LF (\n) is the default record separator, so if you type 3 names and press
enter,
all 3 names get placed in $array[0].
The next item(s) get placed in $array[1], etc depending on where you press
enter.
If your input looks like this:
Fred Barney enter
Wilma Betty enter
your program
Anthony Beaman [EMAIL PROTECTED] wrote in message ?
news:[EMAIL PROTECTED]
I typed in 3. For example, Sam Mary Joe. I expect to get I know Mary,
since she's [1] but I'm getting
a blank space. I've tried this on NT and on my 98 machine here at work.
Hmm, are you just putting spaces between your
Can I dynamically declare an array by doing something like:
for (keys %codes_hash) {
my @$_;
{
so that I have an array for each code in my hash that I can push data to
whatever array is associated with the code that I searching on at that
iteration?
Tim
--
Tim McGeary
[EMAIL
Tim McGeary wrote:
Can I dynamically declare an array by doing something like:
for (keys %codes_hash) {
my @$_;
{
so that I have an array for each code in my hash that I can push data
to whatever array is associated with the code that I searching on at
that iteration?
What you are
Hi,
I was wondering if someone could help me with a problem I am having.
I have a two dimensional array, but I would like to delete an entire
row. What is the most efficient way of doing that? I tried using
splice, but it only shrinks the number of cols and it doesn't get rid of
the entire
From: Tim McGeary [EMAIL PROTECTED]
Can I dynamically declare an array by doing something like:
for (keys %codes_hash) {
my @$_;
{
so that I have an array for each code in my hash that I can push data
to whatever array is associated with the code that I searching on at
that iteration?
Quick question,
is there another way of ending the input of information into an array?
Didn't know that CTRL-Z had to be used to terminate the input from the user
before the rest of the prog would work. :o)
like, for example, is there a way of limiting the size of the array to only
1 or 2
This makes a lot of sense and I think it may be the solution BUT my Ctr-z isn't
working on my machine! I'm on Win98 and when I press ctrl-z it goes to a DOS prompt
(no output). Any ideas on fixing this? If not, I can try this on my NT machine at
home.
-Original
Yes James, I'm trying to redirect to a php page, but as I use print
Content-type: text/html\r\n\r\n; whe I user your cgi
use CGI;
my $q = new CGI;
.
print $q-redirect( ../index.php );
it only writes Status: 302 Moved Location: ../index.php
- Original Message -
From: Kipp, James
I think this situation is handled by the The Camel's code that has a die
clause. Here's a direct quote from my working program, the relevant part
copped straight from page 441:
use IO::Socket::INET;
$server_port = 33000;
$server = IO::Socket::INET-new (LocalPort = $server_port,
Yes James, I'm trying to redirect to a php page, but as I use print
Content-type: text/html\r\n\r\n; whe I user your cgi
use CGI;
my $q = new CGI;
.
print $q-redirect( ../index.php );
it only writes Status: 302 Moved Location: ../index.php
can you explain what you are trying
If I want the following field to contain forwarded slashes - this is for a linux box,
as follows.
$dir=//ITC/home/techs;
How do I get the forward slashes in there?
I have tried:
$dir ='//ITC';
$dir ='//ITC';
$dir =`//ITC`;
Nothing works. Help.
Thank you - Susan
--
To unsubscribe, e-mail:
Good thinking! Might be any ISAM file, for that matter.
-Chris
-Original Message-
From: Josimar Nunes de Oliveira [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 3:11 PM
To: Ned Cunningham; [EMAIL PROTECTED]
Subject: Re: Binary file conversion
Hi all,
May be Cobol
perldoc -f delete
http://www.perldoc.com/perl5.8.0/pod/func/delete.html
delete $array[0];#should delete the first row for example
José.
-Original Message-
From: Sitha Nhok [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 4:10 PM
To: [EMAIL PROTECTED]
Subject: removing a row in
Susan,
Try:
$dir = '//ITC/home/techs';
Your first example should have worked. You didn't need to put additional set of quotes
around the string like you did in the latter examples.
-Original Message-
From: Susan Aurand [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 9:34
Cool. That's way better than using sed. I wish I'd known this at
my last job.
-Chris
-Original Message-
From: Peter Goggin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:08 AM
To: Bakken, Luke; [EMAIL PROTECTED]
Subject: Re: Use of Perl for global changes
Better if you send some relevant lines of your code :)
José.
-Original Message-
From: Miguel Angel Morales [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 4:40 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: perl redirection
It is an IPv6 tunnelbroker, and when the
Yes James, I'm trying to redirect to a php page, but as I
use print
Content-type: text/html\r\n\r\n; whe I user your cgi
use CGI;
my $q = new CGI;
.
print $q-redirect( ../index.php );
it only writes Status: 302 Moved Location: ../index.php
forgot to mention.
I always find that I learn best by attempting to solve a practical
problem, then using the parts of the manual(s) that apply to the problem.
My first Perl program was for my own amusement. It throws the I
Ching for you and prints the hexagrams to STDOUT. That was cool, it had
HI,
I do not remember the link correctly, but u could look emacs mailing
list. start at www.gnu.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Miguel Angel Morales [EMAIL PROTECTED] wrote:
:
: Yes James, I'm trying to redirect to a php page, but
: as I use print Content-type: text/html\r\n\r\n;
: when I user your cgi
:
: use CGI;
: my $q = new CGI;
: .
: print $q-redirect( ../index.php );
:
: it only writes Status: 302 Moved
There is also a dbi-users mailing list that can be very helpful for DBI
related questions.
-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 6:08 AM
To: Sparrow, Dave; [EMAIL PROTECTED]
Subject: RE: Accessing MSSQL database
OK, please keep it
Hi All -
This script:
use strict;
use warnings;
my $string = 'I love c++';
my $compare = 'some compare string';
if ($compare =~ /$string/) {
print $compare contains $string\n;
} else {
print $compare does not contain $string\n;
}
gives this error:
Nested quantifiers in regex; marked
On Wed, 25 Jun 2003, Paul Kraus wrote:
I am running xemacs on windows. I use it for all of my editing
for perl, html, ect... Great editor.
However I just started playing with html::mason and I need to
install the mmm mode in order to get the editor to work well
with embedded material.
I
Paul Kraus wrote:
I am running xemacs on windows. I use it for all of my editing for perl,
html, ect... Great editor.
However I just started playing with html::mason and I need to install
the mmm mode in order to get the editor to work well with embedded
material.
Dowload the .el file and
Hi All -
This script:
use strict;
use warnings;
my $string = 'I love c++';
my $compare = 'some compare string';
if ($compare =~ /$string/) {
print $compare contains $string\n;
} else {
print $compare does not contain $string\n;
}
gives this error:
Nested quantifiers in regex; marked
Try this:
my $string = 'I love c++';
my $compare = 'some compare string';
if ($compare =~ /\Q$string/) { #disables metacharacters until \E
print $compare contains $string\n;
} else {
print $compare does not contain $string\n;
}
-Original Message-
From: Beau E. Cox [mailto:[EMAIL
Howdy:
At the risk of sounding silly, does anyone know
of a way to export data from PostgreSQL to
Oracle via perl featuring DBI?
Background:
I'm running PostgreSQL 7.2.1 on RedHat Linux 7.2
and I have Oracle 9i on the same box. PostgreSQL
is dying and the tool to dump the data (pg_dump)
no
Whenever I do an exercise from one of the
books that assume a unix environment, I skip
the code that gets user input. If the code
is written like this:
my @names = STDIN;
I change it to:
my @names = ( qw/ joe bob jack / );
Then I type (or copy) the rest of the
code from the
Sorry, I'm a unix guy...ctrl-d works on my unix box.
You might try that instead, just to see :)
richf
-Original Message-
From: Anthony Beaman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 10:24 AM
To: Rich Fernandez
Cc: [EMAIL PROTECTED]
Subject: RE: Array Question
This
Ok this lets me compile them. As long as I don't end my emacs session
all the modes are available but if I exit emacs and go back into I have
to re-byte compile them in order to have access to the modes. Any ideas?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
I dont think that works because delete doesnt fill the gap if you
remove it from the middle, but I'm really not sure.
I tried to use delete too, but it is returning the address, and not
the actual content when I tried to do something like this:
Array[$x][$y] = {some list};
Delete
Thanks Tim ans Shishir - Works!
Aloha = Beau;
- Original Message -
From: Tim Johnson [EMAIL PROTECTED]
To: 'Beau E. Cox' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 5:30 AM
Subject: RE: Regex problem
Try this:
my $string = 'I love c++';
my $compare = 'some
The plot thickens! I can get it to work if I have a data in the array, such as my
script below:
print Here are your friends: ;
@friends = qw (Sam Joe Sally);
print @friends\n;
print I know $friends[1];
I still can't grab the element of an array that requests user input though.
Anthony Beaman [EMAIL PROTECTED] wrote:
:
: I still can't grab the element of an array that
: requests user input though.
Forget about the user input part. You're
getting hung up on the wrong concept. The
exercise is about arrays not user input.
HTH,
Charles K. Clarkson
--
Head Bottle
Hi,
(Please don't just reply to a list message if you are starting a new subject
or thread.)
In article [EMAIL PROTECTED], Sitha Nhok wrote:
Hi,
I was wondering if someone could help me with a problem I am having.
I have a two dimensional array, but I would like to delete an entire
In article [EMAIL PROTECTED], Paul Kraus wrote:
I am running xemacs on windows. I use it for all of my editing for perl,
html, ect... Great editor.
However...
[...]
Just a quick note - not sure how much emacs is there, but I've found the ng
comp.editors to be a great help with vi(m).
http://www.gnu.org/software/emacs/windows/ntemacs.html
HTH,
tim
Paul Kraus wrote:
I am running xemacs on windows. I use it for all of my editing for perl,
html, ect... Great editor.
However I just started playing with html::mason and I need to install
the mmm mode in order to get the editor to
Dan Muey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
CGI's remote_user()
rturns $ENV{'REMOTE_USER'};
While
sub user_name {
my ($self) = self_or_CGI(@_);
return $self-http('from') || $ENV{'REMOTE_IDENT'} ||
$ENV{'REMOTE_USER'}; }
SO if I'm trying to get the login
Does anybody know how to redirect from a perl page with a
print Location: http://www.yahoo.com\n\n;;
That's the header anywho. You wouldn't really need the Content-type
line then as there will be not content for that document.
HTH
DMuey
print Content-type: text/html\r\n\r\n; code line?
Howdy:
Howdy
At the risk of sounding silly, does anyone know
of a way to export data from PostgreSQL to
Oracle via perl featuring DBI?
Background:
I'm running PostgreSQL 7.2.1 on RedHat Linux 7.2
and I have Oracle 9i on the same box. PostgreSQL
is dying and the tool to dump the
Hi All!
Howdy!
I have the following trouble:
I have an script in which several code lines must be executed
so if one of these lines is not executed the other lines must
neither be executed, and I would like to know if perl has
something like asp transactions to force the execution
Dave Sparrow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Take a look at Text::CSV or Text::CSV_XS
Ah, but here's the kicker...
Most people who I will give this script to will be running Perl 5.6 and
WILL
NOT have the ability to use any external modules, even those such as 'use
CGI's remote_user()
rturns $ENV{'REMOTE_USER'};
While
sub user_name {
my ($self) = self_or_CGI(@_);
return $self-http('from') || $ENV{'REMOTE_IDENT'} ||
$ENV{'REMOTE_USER'}; }
SO if I'm trying to get the login name I should use
user_name since it
will return
On Tuesday, June 24, 2003 at 4:15 PM, Dan Muey stated:
:
: This is last post for me today I swear!!!
But . . .
On Tuesday, June 24, 2003 at 4:38 PM, Dan Muey posted:
: Cool, Thanks again Jenda, it's coming slowly,
: bit by bit.
Just can't trust that guy!:)
Sorry
Aman Thind [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi All
On receiving no reply to my previous post, I myself struggled a bit and
came
up with the following code to login to the site :
--
use LWP::UserAgent;
use
Unlike others that are suggesting that you forget about user input, I
thought you might want to see how it can work on Windows. I know that it
would bug me as to how to do this if I were in your position...
print Name your friends: ;
@names = split(/[ \n]+/, STDIN);
print I know $names[1].\n;
Oops, the second batch of code has a problem... It should read:
print Name your friends: ;
$friends = STDIN;
chomp($friends);
@names = split(/ +/, STDIN);
print I know $names[1].\n;
Sorry about that...
- Alan
-Original Message-
From: Perry, Alan [mailto:[EMAIL PROTECTED]
Sent:
Here's what I got when I ran it:
C:\perl hello2.pl
Name your friends: Joe Sam Sally
I know .
(good news is that ctrl-z appears to be working again)
When I ran it a second time and skipped a line, it when to the print message after I
skipped a line after Sam.
C:\perl hello2.pl
Name your
Try This Then :
--START--
print Name your friends: ;
$friends = STDIN;
#chomp($friends);
@names = split(/ +/, STDIN);
print I know $names[0].\n;
--END--
I get the following result (which is slightly better)
--START--
C:\SCRIPTS\testperl names4.pl
Name your friends: Derek
Byrne
I know
You did it! I just tried your first one:
print Name your friends: ;
@names = split(/[ \n]+/, STDIN);
print I know $names[1].\n;
It works!! It'll send you to the I know... message if you try to skip a line,
though. But the most important thing is that it'll grab an element from the user's
In article [EMAIL PROTECTED],
Anthony Beaman wrote:
Here's what I got when I ran it:
C:\perl hello2.pl
Name your friends: Joe Sam Sally
I know .
This has been answered already (you have one item in your array), so
$array[1] is empty.
(good news is that ctrl-z appears to be working
Joshua Scott wrote:
What do I need to do in order to use a filehandle that was opened earlier in
a program within a subroutine?
perldoc -q filehandle
Found in /usr/lib/perl5/5.6.0/pod/perlfaq5.pod
How do I flush/unbuffer an output filehandle? Why must I
do this?
How
Kevin Pfeiffer wrote:
It's funny how as soon as you learn/meet/hear/read
something/someone/something you see/hear it/him/her everywhere.
I saw this last night in an article by R. Schwartz and then this morning
again somewhere else. Problem being - how to count to N and then start over
Chern Jian Leaw wrote:
Hi,
Hello,
I have the script below which outputs some values in a tabular form into
the body of a mail. I'm using the format utility in PERL to output the
values in a tabular form as in:
PROG NO VERSION PROTOCOLPORTSERVICE RESPONSE
On Jun 25, Beau E. Cox said:
my $string = 'I love c++';
my $compare = 'some compare string';
if ($compare =~ /$string/) {
print $compare contains $string\n;
} else {
print $compare does not contain $string\n;
}
Why don't you want to use
if (index($compare, $string) -1) { ... }
Hi John,
In article [EMAIL PROTECTED], John W. Krahn wrote:
[...]
perldoc -q filehandle
Found in /usr/lib/perl5/5.6.0/pod/perlfaq5.pod
How do I flush/unbuffer an output filehandle? Why must I
do this?
How can I make a filehandle local to a subroutine? How do
In article [EMAIL PROTECTED], John W. Krahn wrote:
Kevin Pfeiffer wrote:
It's funny how as soon as you learn/meet/hear/read
something/someone/something you see/hear it/him/her everywhere.
I saw this last night in an article by R. Schwartz and then this morning
again somewhere else.
Susan Aurand wrote:
If I want the following field to contain forwarded slashes - this is for a linux
box, as follows.
$dir=//ITC/home/techs;
How do I get the forward slashes in there?
I have tried:
$dir ='//ITC';
$dir ='//ITC';
$dir =`//ITC`;
Nothing works. Help.
Slashes are not
Beau E. Cox wrote:
Hi All -
Hello,
This script:
use strict;
use warnings;
my $string = 'I love c++';
my $compare = 'some compare string';
if ($compare =~ /$string/) {
print $compare contains $string\n;
} else {
print $compare does not contain $string\n;
}
gives this
Newbie answer here - if you change the line
my $string = 'I love c++';
to be
my $string = 'I love c\++';
it runs, but, you also get this output :
C:\SCRIPTS\testperl lovec.pl
some compare string does not contain I love c\++
DerekB
-Original Message-
From: John W. Krahn
1 - 100 of 122 matches
Mail list logo