Is there a way in perl to peek the next line in the file while keeping
the line pointer the same?
I want to do something like this:
while ()
{
//do some stuff
//?? peek next line ?? and enter conditional block//
//do some more stuff
}
Of course, there are workarounds, but it would
On Sep 27, 2007, at 1:29 AM, Mahurshi Akilla wrote:
Is there a way in perl to peek the next line in the file while keeping
the line pointer the same?
I want to do something like this:
while ()
{
//do some stuff
//?? peek next line ?? and enter conditional block//
//do some more
Hi, i am using the following script to find a file entered by a user.
use Win32::DriveInfo;
use File::Find;
my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a
Machine
my [EMAIL PROTECTED]; #Number of Drives
my $i=$cnt; #Counter assignment
#The following loop appends "/"
Hi, i am using the following script to find a file entered by a user.
use Win32::DriveInfo;
use File::Find;
my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a
Machine
my [EMAIL PROTECTED]; #Number of Drives
my $i=$cnt; #Counter assignment
#The following loop appends "/"
Hi,
I have a UNIX directory $DIR which contains a lot of files and
subdirecotires. Now, I would
like to list all files and subdirectories in $DIR only. That means,
$File::Find should not
go into any subdirectories of $DIR and list the files and
subdirectories there as well.
So far, I have not
On Sep 27, 1:29 am, [EMAIL PROTECTED] (Perler) wrote:
> [a multipost]
Please don't multipost.
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
h
Check for each name if it is a directory by
-d $fname
and then print it if it returns false.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 26 Sep, 20:38, [EMAIL PROTECTED] (Yitzle) wrote:
> On 9/26/07, raaki <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > hi friends
>
> > recently i started learning perl.i need to print some statements after
> > perticular line.in my file there is one line called "puts
> > conCheckFAIL#---"occuri
schms wrote:
Hi,
Hello,
I have a UNIX directory $DIR which contains a lot of files and
subdirecotires. Now, I would like to list all files and
subdirectories in $DIR only. That means, $File::Find should not
go into any subdirectories of $DIR and list the files and
subdirectories there as wel
Perler wrote:
Hi,
Hello,
i am using the following script to find a file entered by a user.
use warnings;
use strict;
use Win32::DriveInfo;
use File::Find;
my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a
Machine
my [EMAIL PROTECTED]; #Number of Drives
my $i=$cnt
Hi I am trying to capture only the first occurence of a charcter
followed by any word ie: in this sample text
!this is a first level heading
!!this is a 2nd level heading
I only want to find the first item and not the second
current code
$line=~s/\!(^\![A-Z][a-z].+)/$1/gc;
it either doesnt cap
On Sep 27, 8:37 am, [EMAIL PROTECTED] (John W. Krahn) wrote:
> > If i run this script i am getting the error as "Invalid top directory
> > at d:\perl\lib\file\find.pm line 562, line164"
>
> This script doesn't have 562 lines and nowhere are you using a DATA filehandle
> so it is hard to say why t
On Sep 27, 6:00 am, [EMAIL PROTECTED] (Schms) wrote:
> I have a UNIX directory $DIR which contains a lot of files and
> subdirecotires. Now, I would
>
> like to list all files and subdirectories in $DIR only. That means,
> $File::Find should not
>
> go into any subdirectories of $DIR and list the
I am trying to use perl on the command line to process text files in
various ways, one of which is to decode html entities. As far as I can
see, the following line should work
perl -MHTML::Entities -p -e 'decode_entities($_)' output.txt
it does indeed change the html entities, but not into the r
On Sep 27, 8:58 am, [EMAIL PROTECTED] (Mike Martin) wrote:
> Hi I am trying to capture only the first occurence of a charcter
> followed by any word ie: in this sample text
>
> !this is a first level heading
> !!this is a 2nd level heading
>
> I only want to find the first item and not the second
>
Mike Martin wrote:
Hi I am trying to capture only the first occurence of a charcter
followed by any word ie: in this sample text
!this is a first level heading
!!this is a 2nd level heading
I only want to find the first item and not the second
current code
$line=~s/\!(^\![A-Z][a-z].+)/$1/gc;
[EMAIL PROTECTED] wrote:
I am trying to use perl on the command line to process text files in
various ways, one of which is to decode html entities. As far as I can
see, the following line should work
perl -MHTML::Entities -p -e 'decode_entities($_)'
output.txt
it does indeed change the htm
> "jeevs" == jeevs <[EMAIL PROTECTED]> writes:
jeevs> Hi Forum!!!
jeevs> I want to plot a graph on a web page. I am using the GD::Graph
jeevs> module and can successfully plot the graph. The graph is displayed on
jeevs> the web page with the following code.
CGI questions are better asked
Rob Dixon wrote:
Mike Martin wrote:
$line=~s/\!(^\![A-Z][a-z].+)/$1/gc;
$line =~ s/^!(![a-z].+)/$1/gi;
You are both using an anchored pattern with the /g option which makes no sense
unless you are also using the /m option.
John
--
Perl isn't a toolbox, but a small machine shop where y
Hi All,
I am new to perl. I am using "Active Perl-5.8.8"
I want to set environment variable in a perl script
Ex - #!/usr/bin/perl
$ENV{HAI} = "hai";
and want to display the contents of the environment
variable i
On 27 Sep 2007 14:47:42 -, vikram vikram vikram
<[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I am new to perl. I am using "Active Perl-5.8.8"
>
> I want to set environment variable in a perl script
>
> Ex - #!/usr/bin/perl
> $ENV{HAI} = "hai"
27 Sep 2007 14:47:42 -, vikram vikram vikram <[EMAIL PROTECTED]>:
>
> Hi All,
>
> I am new to perl. I am using "Active Perl-5.8.8"
>
> I want to set environment variable in a perl script
>
> Ex - #!/usr/bin/perl
> $ENV{HAI} = "hai";
>
>
>
can't you set the environmental variables for the parent shell
by running a script as a . or here file?
-Original Message-
>From: Jeff Pang <[EMAIL PROTECTED]>
>Sent: Sep 27, 2007 10:02 AM
>To: vikram vikram vikram <[EMAIL PROTECTED]>
>Cc: beginners@perl.org
>Subject: Re: How to set env
2007/9/27, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> can't you set the environmental variables for the parent shell
> by running a script as a . or here file?
>
Can you?
you can do it via shell's `source`,but not perl.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Hi all
Error 500 error is the follwoing
[Thu Sep 27 16:26:56 2007] [error] [client 10.16.153.99] Prototype mismatch:
sub main::head: none vs ($) at /var/www/cgi-bin/srHandler4.cgi line 7
[Thu Sep 27 16:26:57 2007] [error] [client 10.16.153.99] [Thu Sep 27
16:26:57 2007] srHandler4.cgi: Error 500 o
On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> can't you set the environmental variables for the parent shell
> by running a script as a . or here file?
snip
When you use Korn, Bourne, BASH, etc. and say ". " or "source " before
a script, it runs in the current process (i.e. the interp
On 9/27/07, Pat Rice <[EMAIL PROTECTED]> wrote:
> Line 25 -- shown below, is just a simple getstore, this works when run from
> the command line, but when run form the webserver, I get above error
> message, I've tried the usual 500 error messages, just wondering if anyone
> has any ideas ???
A "
On Sep 27, 11:59 am, [EMAIL PROTECTED] (Pat Rice) wrote:
> Hi all
> Error 500 error is the follwoing
>
> [Thu Sep 27 16:26:56 2007] [error] [client 10.16.153.99] Prototype mismatch:
> sub main::head: none vs ($) at /var/www/cgi-bin/srHandler4.cgi line 7
> [Thu Sep 27 16:26:57 2007] [error] [client
Is there any way to get the name of a variable by knowing its memory
address?
Thanks,
Zach
Mike Martin wrote:
On 27/09/2007, Rob Dixon <[EMAIL PROTECTED]> wrote:
Mike Martin wrote:
Hi I am trying to capture only the first occurence of a charcter
followed by any word ie: in this sample text
!this is a first level heading
!!this is a 2nd level heading
I only want to find the first
Hello,
If this is the wrong place to post please point out the correct list.
Here is the problem, I have RHEL AS 4 update 5 with perl v5.8.5. I would
like to install a newer version in /usr/local/perl5.8.8. I do the following:
sh Configure -de -Dprefix=/usr/local/perl5.8.8
make
[ I get the foll
On Thu, Sep 27, 2007 at 01:11:11PM -0400, Zachary Shay wrote:
> Is there any way to get the name of a variable by knowing its memory
> address?
Some hairy XS might get you an 80% solution, but in general, no.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [
On 9/27/07, CyberDESI <[EMAIL PROTECTED]> wrote:
> Here is the problem, I have RHEL AS 4 update 5 with perl v5.8.5. I would
> like to install a newer version in /usr/local/perl5.8.8. I do the following:
>
> sh Configure -de -Dprefix=/usr/local/perl5.8.8
> make
...
> Can someone point out what I am
[EMAIL PROTECTED] wrote:
Hello
Hello,
I have a string that contains a full path and file name. What is
the easiest way to extract the file name? For example the path is
/dir1/dir2/dir3/file.txt.
$ perl -le'
use File::Basename;
my $full_path = q[/dir1/dir2/dir3/file.txt];
my $file_name =
Hello
I have a string that contains a full path and file name. What is the easiest
way to extract the file name? For example the path is /dir1/dir2/dir3/file.txt.
Andrew
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi,
For the first time when installing this bundle I got an error. It did complete
a dozen other modules but failed on the test of this one as you can see below.
It seems I could either try to reinstall (which I did a few times and it
always fail at the same test) or remove it. Which I have no
[EMAIL PROTECTED] wrote:
My problem is that the regular expression is only displaying the first
item (mrn) but it won't display the others (enc, date,
report_subtitle)
My code is on the following line
#!/usr/bin/perl
#open(FILE, "3688001.ps");
open(FILE, "1234567.txt");
while ($buf = ) {
Si
Hello,
I'm having a problem with a regular expression in some code that I
inherited.
I'm reading from a file and looking for certain parameters (mrn, enc,
date, report_subtitle).
The file looks like this:
%%start
%mrn%02333699
%fac%A
%gpi%
%enc%972014
%date%07/07/2007^14:29
%report_type%ami
[EMAIL PROTECTED] wrote:
Hello,
Hello,
I'm having a problem with a regular expression in some code that I
inherited.
I'm reading from a file and looking for certain parameters (mrn, enc,
date, report_subtitle).
The file looks like this:
%%start
%mrn%02333699
%fac%A
%gpi%
%enc%972014
%d
On Thursday 27 September 2007 19:41:53 Tom Phoenix wrote:
> On 9/27/07, Bobby <[EMAIL PROTECTED]> wrote:
> > t/03pkgsok 1/11
> >
> > (Here I pressed Ctrl-C after a few hours (I went to bed) of sitting on
> > test 1/11.)
>
> It sounds as if the script gets stuck in an infinite loop. Have
On 9/27/07, Bobby <[EMAIL PROTECTED]> wrote:
> t/03pkgsok 1/11
>
> (Here I pressed Ctrl-C after a few hours (I went to bed) of sitting on test
> 1/11.)
It sounds as if the script gets stuck in an infinite loop. Have you
looked at the test script to see why it might get stuck at that p
On 27 Sep., 15:01, [EMAIL PROTECTED] (Paul Lalli) wrote:
> On Sep 27, 6:00 am, [EMAIL PROTECTED] (Schms) wrote:
>
> > I have a UNIX directory $DIR which contains a lot of files and
> > subdirecotires. Now, I would
>
> > like to list all files and subdirectories in $DIR only. That means,
> > $File:
On Sep 27, 12:27 pm, [EMAIL PROTECTED] wrote:
> I am trying to use perl on the command line to process text files in
> various ways, one of which is to decode html entities. As far as I can
> see, the following line should work
>
> perl -MHTML::Entities -p -e 'decode_entities($_)'
> >output.txt
>
On Sep 27, 6:11 pm, [EMAIL PROTECTED] (Zachary Shay) wrote:
> Is there any way to get the name of a variable by knowing its memory
> address?
Not in general in a reasonable time.
Anyhow, how would you know the address of a variable in Perl?
What do you mean by "the name"? An SV in Perl can have
On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I am failing on opens now because the file is read only. What is the way
> to open a file read only.
Normally, it's done in the exact same way that you open any file that
you don't explicitly intend to write to. What are you trying that's
Hello
I appreciate the response to the last question. I have scripts that I have
opened files and they work. However, I am failing on opens now because the file
is read only. What is the way to open a file read only.
Andrew
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Hi,
What is the command to tell cpan to accept the default/suggested values?
--
Bobby
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi,
It was suggested that I look over the test script. However this is clear to
me. Can anyone say what is wrong from looking here or maybe can direct me
where to look for more? (I'm not a Perl programmer.)
I get the idea that maybe it's checking what the version number is when
getting stuck i
28 Sep 2007 03:45:54 -, vikram vikram vikram <[EMAIL PROTECTED]>:
>
>
>
> Hi All,
>
> Yes i tried by copying the file to .env and executed the .env.
>
> But still the environment variable is not set. Please suggest some
> solution for setting the environment variable. May be some
Hi Vikram,
You are not able to access the env variable coz it is not set as you have
wished.
Do like the following.
Set environment variable using export.
export HAI=hai
and print the from your perl script.
The above command sets the environment variable in your system EVN variables
and you c
50 matches
Mail list logo