Re: read file attributes

2012-07-30 Thread Irfan Sayed
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

Re: read file attributes

2012-07-30 Thread Rob Coops
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

Re: Read File Problem

2008-07-29 Thread Dr.Ruud
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

Re: Read File Problem

2008-07-23 Thread Gunnar Hjalmarsson
[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:/

Re: Read File Problem

2008-07-23 Thread Rob Dixon
[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. >

Re: read file

2007-07-11 Thread Rob Dixon
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

Re: read file

2007-07-11 Thread Chas Owens
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 >

Re: read file

2007-07-11 Thread Chas Owens
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

Re: read file

2007-07-11 Thread Chas Owens
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

Re: read file

2007-07-11 Thread Chas Owens
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

Re: read file

2007-07-11 Thread Tom Phoenix
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

Re: read file, search for a string, write results

2007-07-07 Thread Paul Lalli
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

RE: read file in from bottom instead of top

2003-01-13 Thread Mark Anderson
> 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

RE: read file in from bottom instead of top

2003-01-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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. > > >

Re: read file in from bottom instead of top

2003-01-13 Thread Paul Johnson
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

Re: Read file from second line

2002-08-26 Thread Q
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

Re: Read file from second line

2002-08-26 Thread Felix Geerinckx
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

Re: Read file from second line

2002-08-26 Thread Tanton Gibbs
>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

Re: Read file symbol by symbol?

2002-04-17 Thread Ramis
"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

Re: Read file symbol by symbol?

2002-04-16 Thread Jonathan E. Paton
> 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..

Re: Read file symbol by symbol?

2002-04-16 Thread Sudarsan Raghavan
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

Re: Read file symbol by symbol?

2002-04-16 Thread Dave K
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"