thanks rob. how about Win32::File?
regards
irfan
From: Rob Coops
To: Irfan Sayed
Cc: "beginners@perl.org"
Sent: Monday, July 30, 2012 5:23 PM
Subject: Re: read file attributes
On Mon, Jul 30, 2012 at 1:24 PM, Irfan Sayed wrote:
hi,
&g
On Mon, Jul 30, 2012 at 1:24 PM, Irfan Sayed wrote:
> hi,
>
> i need to access the attributes of file.
> more precisely, i need to check if the file is digitally signed or not
>
>
> for example; if i right click on file, then i need to check if the
> "digital signature" tab is there or not for tha
Rob Dixon schreef:
> my $contents = do {
> open my $fh, $source_file or die $!;
> local $/;
> <$fh>;
> };
That has the file's contents in memory twice. This is leaner:
my $contents;
{
open my $fh, $source_file or die $!;
local $/;
$contents = <$fh>;
};
--
Affi
[EMAIL PROTECTED] wrote:
How can I get the read line to read the entire file?
That's a FAQ.
perldoc -q "entire file"
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http:/
[EMAIL PROTECTED] wrote:
>
> I am trying to read a text file with carriage returns and line feeds on a
> unix system and for some reason it will read only one of text. I use the same
> code in a different perl script and I can read a file that does not have
> carriage returns and line feeds.
>
jeniffer wrote:
I have a file of the format
action arg1 \
arg2 \
arg3 \
action2 arg1 \
arg2 \
arg3 \
I read this by :-
foreach $line (@lines)
{
($action , @argument_list) = split(/\s+/,$line);
This would work fine if the file is of the
format
ac
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote:
> On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote:
> snip
> > my $rec = '';
> > while (<>) {
> > if (/\\$/) { #if line is a continuation
> > chop; #remove the continuation character
>
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
> my $rec = '';
> while (<>) {
> if (/\\$/) { #if line is a continuation
> chop; #remove the continuation character
> $rec .= $_;
> next;
> }
> my @rec = sp
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
my $rec = '';
while (<>) {
if (/\\$/) { #if line is a continuation
chop; #remove the continuation character
$rec .= $_;
next;
}
my @rec = split ' ', $rec;
$rec = '';
#do stuff with @rec
}
snip
Who
On 7/11/07, jeniffer <[EMAIL PROTECTED]> wrote:
I have a file of the format
action arg1 \
arg2 \
arg3 \
action2 arg1 \
arg2 \
arg3 \
I read this by :-
foreach $line (@lines)
{
($action , @argument_list) = split(/\s+/,$line);
This would work fine
On 7/11/07, jeniffer <[EMAIL PROTECTED]> wrote:
I have a file of the format
action arg1 \
arg2 \
arg3 \
action2 arg1 \
arg2 \
arg3 \
In other words, some of the file's "lines" are more than a single line
each; a continued line ends with a backslash. Per
On Jul 7, 6:16 am, [EMAIL PROTECTED] wrote:
> I am new to perl and would like to:
>
> 1. read preprocessed source code in multiple directories
> 2. searching these files for #line
> 3. build non duplicate array of path/filenames that follow #line
> 4. write results to a file
>
> Any direction, poin
> I have tried to read a file in backwards in stead of from the top
> without any success !!!
http://search.cpan.org/author/URI/File-ReadBackwards-0.99/ReadBackwards.pm
/\/\ark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
Larry Sandwick wrote:
> I have tried to read a file in backwards in stead of from the top
> without any success !!!
>
> The original code looks like this .
>
> open(DATABASE, " read!\n";
>
> I have tried the following.
>
> I do not get any errors from Perl, it just ignores the command.
>
>
>
On Mon, Jan 13, 2003 at 04:15:20PM -0500, Larry Sandwick wrote:
> I have tried to read a file in backwards in stead of from the top
> without any success !!!
http://search.cpan.org/author/URI/File-ReadBackwards-0.99/
> Any suggestion would be helpful.
_Always_ search CPAN first :-)
--
Paul Jo
Thank you Tanton, Felix;
- Original Message -
From: "Felix Geerinckx" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 26, 2002 5:32 PM
Subject: Re: Read file from second line
> on Mon, 26 Aug 2002 15:15:06 GMT, [EMAIL PROTECTED] (Q) wrote:
&g
on Mon, 26 Aug 2002 15:15:06 GMT, [EMAIL PROTECTED] (Q) wrote:
> Apologies for such a 'lame' question but i read the FAQ on
> http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq5-full.html
>
> How do i read on from the second line of a text file?
You start reading from the first line but throw
>How do i read on from the second line of a text file?
Just read in the first line and ignore it
open FILE, "file.txt" or die "Could not open file.txt: $!\n";
my $first_line = ;
# now FILE is at the second line.
while( ) {
# do your processing
}
Tanton
--
To unsubscribe, e-mail: [EMAIL
"Jonathan E. Paton" wrote:
> You don't want to, reading one character
> at a time is VERY slow. At worst, the
> operating system will cut short your
> time slot whilst it waits for the file
> access - perhaps limiting you to a few
> dozen characters per second...
>
> if you care much for that
> how read a file one by one symbols, not
> a whole string once at time?
You don't want to, reading one character
at a time is VERY slow. At worst, the
operating system will cut short your
time slot whilst it waits for the file
access - perhaps limiting you to a few
dozen characters per second..
Dave K wrote:
> Here is one script I used to inspect files
>
> use strict;
> my $fn;
> print"Enter the name of a file you want to examine ";
> while (<>) {
It is better to write this as while (). The reason being if all
the command
line arguments (if any are provided) have not been shifted
Here is one script I used to inspect files
use strict;
my $fn;
print"Enter the name of a file you want to examine ";
while (<>) {
$fn = $_;
last if $fn;
}
print "Opening $fn\n";
open TF, "$fn" or die "Cannot open $fn:$!\n";
my @ov;
my $ov;
while () {
@ov = unpack('U*',$_);
print;
print"\t\t"
22 matches
Mail list logo