hi, who can tell me which is better of the following codes?
why there are different methods to read files?
thanks
1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading:
$!\n";
while () {
print if /blue/;
}
close(INPUT);
2. use IO::File;
$input = IO::File->ne
On Jan 10, 2008 4:39 PM, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I'm writing a script that basically creates a bunch of files, packages
> them up (tar/gz), and mails them out.
> I can handle all of that, but before I mail them I also have to password
> protect the archive like
On Jan 10, 2008 4:43 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> Zembower, Kevin wrote:
> > I'm trying to write a program in which I have to make two passes through
> > the file. I want to call the file on the command line and process it
> > with 'while (<>){...'. Can I use something like '
Gunnar Hjalmarsson wrote:
Zembower, Kevin wrote:
I'm trying to write a program in which I have to make two passes through
the file. I want to call the file on the command line and process it
with 'while (<>){...'. Can I use something like 'seek STDIN, 0, 0'
between the two while loops to reset t
"John W. Krahn" <[EMAIL PROTECTED]> writes:
> The -l test will tell you if a file is a symlink and readlink() will
> read the contents of that symlink.
>
> if ( -l $file && -d readlink $file ) {
> print "$file is a symlink that points to a directory\n";
> }
Ahh nice... thanks
--
To uns
"Chas. Owens" <[EMAIL PROTECTED]> writes:
> perldoc -f -X
Ack... I was trying perldoc -f X
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Jan 10, 2008 1:22 PM, Tim McGeary <[EMAIL PROTECTED]> wrote:
> Gunnar Hjalmarsson wrote:
> > Tim McGeary wrote:
> >> I have a perl script that runs on the command line that I need run as
> >> a CGI on a webserver, but the system commands I'm using in the script
> >> require that I run it as a sp
On Jan 10, 2008 4:28 PM, ciwei <[EMAIL PROTECTED]> wrote:
>
> > push @{ $wwn{ "$host-$hba" } }, /^\s+WWN:\s+(1000[0-9a-fA-F]{12})$/;
>
> Thanks for the help.
>
> can you please explain in the above line , what the { } around
> push @{ $wwn ... } <--here do ?
>
> is the { } here optional? or can t
Tim McGeary wrote:
Gunnar Hjalmarsson wrote:
I don't know anything about wrapsuid, but I have successfully
controlled the uid or gid of a single script via a C wrapper as
described at http://perldoc.perl.org/perlsec.html#Security-Bugs
I've heard dubious security issues about using a C wrapper
Zembower, Kevin wrote:
I'm trying to write a program in which I have to make two passes through
the file. I want to call the file on the command line and process it
with 'while (<>){...'. Can I use something like 'seek STDIN, 0, 0'
between the two while loops to reset the diamond operator to the
Hi folks,
I'm writing a script that basically creates a bunch of files, packages
them up (tar/gz), and mails them out.
I can handle all of that, but before I mail them I also have to password
protect the archive like pkzip does.
I really don't want to shell out to pkzip if I can avoid it.
I check
> push @{ $wwn{ "$host-$hba" } }, /^\s+WWN:\s+(1000[0-9a-fA-F]{12})$/;
Thanks for the help.
can you please explain in the above line , what the { } around
push @{ $wwn ... } <--here do ?
is the { } here optional? or can this be subsitute with ( )?
thanks.
--
To unsubscribe, e-mail: [EMAIL
On Jan 10, 2008 2:06 PM, <[EMAIL PROTECTED]> wrote:
> "Chas. Owens" <[EMAIL PROTECTED]> writes:
>
> > The -X operators follow the symlink.
>
> Where is there a list of the -X operators
> perldoc perlop doesn't mention it. Or at least
> /\-X in that page doesn't find anything.
>
> > if (-d $symlin
Gunnar Hjalmarsson wrote:
Tim McGeary wrote:
I have a perl script that runs on the command line that I need run as
a CGI on a webserver, but the system commands I'm using in the script
require that I run it as a specific user and will not let the
webserver user run them.
I've been investigat
Tim McGeary wrote:
I have a perl script that runs on the command line that I need run as a
CGI on a webserver, but the system commands I'm using in the script
require that I run it as a specific user and will not let the webserver
user run them.
I've been investigating possibilities like Apac
I'm trying to write a program in which I have to make two passes through
the file. I want to call the file on the command line and process it
with 'while (<>){...'. Can I use something like 'seek STDIN, 0, 0'
between the two while loops to reset the diamond operator to the
beginning of the input fi
Greetings,
I have a perl script that runs on the command line that I need run as a
CGI on a webserver, but the system commands I'm using in the script
require that I run it as a specific user and will not let the webserver
user run them.
I've been investigating possibilities like Apache suEX
[EMAIL PROTECTED] wrote:
"Chas. Owens" <[EMAIL PROTECTED]> writes:
On 1/10/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'm working on a little script that will generate an html page from a
directory full of symlinks to target directories. However in some
cases there may be symlinks that
"Chas. Owens" <[EMAIL PROTECTED]> writes:
> The -X operators follow the symlink.
Where is there a list of the -X operators
perldoc perlop doesn't mention it. Or at least
/\-X in that page doesn't find anything.
> if (-d $symlink && -r $symlink) {
> print "$symlink points to a readable direc
"Chas. Owens" <[EMAIL PROTECTED]> writes:
> On 1/10/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> I'm working on a little script that will generate an html page from a
>> directory full of symlinks to target directories. However in some
>> cases there may be symlinks that point to regular f
Kevin Viel wrote:
I have a file with thousands of fields, but a subsequent program can only
had 3000. I have to break this file up, for simplicity:
1-03000
03001-06000
Hopefully, a basic outline of my code will suffice to get informative
advice.
my $cnt = -1 ;
my $subset = 1 ;
foreach (
[EMAIL PROTECTED] writes:
> I'm working on a little script that will generate an html page from a
> directory full of symlinks to target directories. However in some
> cases there may be symlinks that point to regular files.
>
> How can perl tell the difference. Or rather how can I test the
> sy
On 1/10/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm working on a little script that will generate an html page from a
> directory full of symlinks to target directories. However in some
> cases there may be symlinks that point to regular files.
>
> How can perl tell the difference. Or
On 1/9/08, vijay <[EMAIL PROTECTED]> wrote:
> I am using Graph::Directed module but there does not seem to be a way
> to test if one graph is a subgraph of another.
If you don't care about isomorphism it is fairly easy. Let's say we have a
graph
a-b-c-d
|
e-f
|
g
and we want to know if
e-f
|
I'm working on a little script that will generate an html page from a
directory full of symlinks to target directories. However in some
cases there may be symlinks that point to regular files.
How can perl tell the difference. Or rather how can I test the
symlink to see if it points at a real op
> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 10, 2008 8:26 AM
> To: Perl Beginners
> Subject: Re: open and close a filehandle
>
> Kevin Viel wrote:
> > I have a file with thousands of fields, but a subsequent
> program can
> > only had
On Jan 10, 2008 2:09 AM, <[EMAIL PROTECTED]> wrote:
> I am trying to bcp in data into a table from inside a perl script.
> Though the data gets inserted into the table but still I am getting
> following error :
>
> sh: Starting: execute permission denied
> sh: 8: execute permission denied
> sh: s
On Jan 9, 2008 6:54 PM, <[EMAIL PROTECTED]> wrote:
> I have a serties of strings
>
> john doe
> sam f smith
> joe s thomas jr
>
>
> i need a regex that will return each word in the string. I have tries
> variations on (.*)\b(.*) but i can't get it. what is the proper
> syntax?
Have you consider
On Jan 9, 2008 3:18 PM, vijay <[EMAIL PROTECTED]> wrote:
> I am using Graph::Directed module but there does not seem to be a way
> to test if one graph is a subgraph of another.
If there's not already a module on CPAN that does what you want, you
can write one of your own.
http://search.cpan
I have a serties of strings
john doe
sam f smith
joe s thomas jr
i need a regex that will return each word in the string. I have tries
variations on (.*)\b(.*) but i can't get it. what is the proper
syntax?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On Jan 9, 2008 6:26 PM, ciwei <[EMAIL PROTECTED]> wrote:
> Thanks for answering my question.
> > I don't understand your second question, could you break your input
> > into records so we can clearly see what how you want to define the
> > records?
>
> My data looks like this: the rcord is variable
On Jan 10, 2008 9:26 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
> > if ( $cnt = 0 ) {
>
> You are assigning 0 to $cnt so $cnt will always be false and the else
> block will always execute.
snip
This is one of the reasons the warnings and strict pragmas are so
important. The warnings prag
On Wednesday 09 January 2008 18:03:37 you wrote:
> I have a file with thousands of fields, but a subsequent program can only
> had 3000. I have to break this file up, for simplicity:
>
> 1-03000
> 03001-06000
>
> Hopefully, a basic outline of my code will suffice to get informative
> advice.
>
Kevin Viel wrote:
I have a file with thousands of fields, but a subsequent program can only
had 3000. I have to break this file up, for simplicity:
1-03000
03001-06000
Hopefully, a basic outline of my code will suffice to get informative
advice.
my $cnt = -1 ;
my $subset = 1 ;
foreach (
Greetings,
I am trying to bcp in data into a table from inside a perl script.
Though the data gets inserted into the table but still I am getting
following error :
sh: Starting: execute permission denied
sh: 8: execute permission denied
sh: syntax error at line 4: `(' unexpected
sh: Starting: exe
I am using Graph::Directed module but there does not seem to be a way
to test if one graph is a subgraph of another.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thanks for answering my question.
> I don't understand your second question, could you break your input
> into records so we can clearly see what how you want to define the
> records?
My data looks like this: the rcord is variable in the number of
lines.
I'm tring to push all WWN that start with 1
I have a file with thousands of fields, but a subsequent program can only
had 3000. I have to break this file up, for simplicity:
1-03000
03001-06000
Hopefully, a basic outline of my code will suffice to get informative
advice.
my $cnt = -1 ;
my $subset = 1 ;
foreach ( 1..6000 ){
$cnt++
38 matches
Mail list logo