>
> use strict;
> use warnings;
> use Tie::File;
>
> my @array;
> tie @array, 'Tie::File', FILENAME or die "Couldn't open file: $!"
>
> unshift @array, <<'END_PREPEND';
> ENTHDR|1|3.0
> STAGEHDR|Barcoded
> END_PREPEND
>
Haven't tested it, but it should work.
http://perldoc.perl.org/Tie/File.html
On Fri, Jan 21, 2011 at 5:35 PM, jet speed wrote:
>
>
> On Fri, Jan 21, 2011 at 5:18 PM, Jim Gibson wrote:
>
>> On 1/21/11 Fri Jan 21, 2011 8:43 AM, "jet speed"
>> scribbled:
>>
>> > Hi All,
>> > I need some help with the blow.
>> >
>> > I have a an input file with the below data
>> >
>> > 18
On 1/21/11 Fri Jan 21, 2011 8:43 AM, "jet speed"
scribbled:
> Hi All,
> I need some help with the blow.
>
> I have a an input file with the below data
>
> 1835
> 1836
> 1837
> 1838
> 1839
> 183A
> 183B
> 183C
> 183D
>
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $filename;
> $f
Hi there,
I'm using the FCGI module (version 0.67) and a lighttpd
to create an imageserver.
But currently I have the problem that if I
shutdown the lighttpd server, the perl processes are still there with an
open file descriptor to the socket.
There are not a child process
anymore and are o
On Fri, Jan 21, 2011 at 5:57 PM, Rob Coops wrote:
>
>
> On Fri, Jan 21, 2011 at 5:43 PM, jet speed wrote:
>
>> Hi All,
>> I need some help with the blow.
>>
>> I have a an input file with the below data
>>
>> 1835
>> 1836
>> 1837
>> 1838
>> 1839
>> 183A
>> 183B
>> 183C
>> 183D
>>
>>
>> #!/usr/bin
On Fri, Jan 21, 2011 at 5:43 PM, jet speed wrote:
> Hi All,
> I need some help with the blow.
>
> I have a an input file with the below data
>
> 1835
> 1836
> 1837
> 1838
> 1839
> 183A
> 183B
> 183C
> 183D
>
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $filename;
> $filename = "input.
sorry!
$line_count at the end of the while block should be $line_count++
On Fri, Jan 21, 2011 at 10:54 AM, jbiskofski wrote:
> my $line_count = 1;
> my @captured_elements;
>
> open(FILE, $filename) || die 'cant open file';
> while () {
> chomp;
> push(@captured_elements, $_) unless ($li
my $line_count = 1;
my @captured_elements;
open(FILE, $filename) || die 'cant open file';
while () {
chomp;
push(@captured_elements, $_) unless ($line_count % 4);
$line_count;
}
close(FILE);
---
% is the modulus operator, it returns the remainder of a division so ... 6 %
4 = 2, 7
Hi All,
I need some help with the blow.
I have a an input file with the below data
1835
1836
1837
1838
1839
183A
183B
183C
183D
#!/usr/bin/perl
use strict;
use warnings;
my $filename;
$filename = "input.txt" ;
open (FILE, "< $filename" ) or die "Could not open $filename: $!";
while () {
chomp
Hi Ary,
On Friday 21 Jan 2011 17:39:48 Ary Kleinerman wrote:
> Shlomi,
>
> On Fri, Jan 21, 2011 at 12:13 PM, Shlomi Fish wrote:
> > Hi Ary,
> >
> > On Friday 21 Jan 2011 16:01:36 Ary Kleinerman wrote:
> > > A simple way:
> > >
> > > #!/usr/bin/perl -w
> > > open FILE, ">>file.txt";
> > > print
I would recommend using the IRC chat or SDL mailing list found here:
http://sdl.perl.org/index.html
At least one of the members that is working on the development side is
coding on a Mac as well (Unfortunately I don't remember the name). kthakore
is generally in the IRC channel most of the time a
Shlomi,
On Fri, Jan 21, 2011 at 12:13 PM, Shlomi Fish wrote:
> Hi Ary,
>
> On Friday 21 Jan 2011 16:01:36 Ary Kleinerman wrote:
> > A simple way:
> >
> > #!/usr/bin/perl -w
> > open FILE, ">>file.txt";
> > print FILE "line1\n";
> > print FILE "line2\n";
> > print FILE "ENTHDR|1|3.0\n";
> > print
Hi Francesco,
On Friday 21 Jan 2011 16:20:51 Francesco Di Lorenzo wrote:
> Hi everyone,
> I've just finished reading Learning Perl by O'Really and I want to learn
> something that can give me something more pleasant to work on, something
> funny, I want to program some basic games like pong...
> F
Hi Ary,
On Friday 21 Jan 2011 16:01:36 Ary Kleinerman wrote:
> A simple way:
>
> #!/usr/bin/perl -w
> open FILE, ">>file.txt";
> print FILE "line1\n";
> print FILE "line2\n";
> print FILE "ENTHDR|1|3.0\n";
> print FILE "STAGEHDR|Barcoded\n";
> close FILE;
>
This script will *append* 4 lines to
On 20/01/2011 19:10, steve1040 wrote:
Using the script below I need to add a second line with the following
text:
"STAGEHDR|Barcoded"
#!perl
use strict;
use warnings;
my $file = 'path/to/Access.csv';
my $newline = "ENTHDR|1|3.0";
{
local @ARGV = ($file);
local $^I = '.bac';
while(<>
On 21/01/2011 05:50, Erez Schatz wrote:
On 20 January 2011 15:38, Eyal B. wrote:
I'm getting an error on the line where I should use the TTL variable -
and take the right value from the hash (%list) :Use of uninitialized
value in print at D:\system\perl\os-rec\os-rec5_.pl line 24
, line 3.
A
Hi everyone,
I've just finished reading Learning Perl by O'Really and I want to learn
something that can give me something more pleasant to work on, something
funny, I want to program some basic games like pong...
For this I've found a book that introduces SDL, but I don't know how to
install all t
On Thursday 20 Jan 2011 19:40:55 Chris Stinemetz wrote:
> I am having difficulty using $= correctly to change the number of lines per
> page. I would like to set it to 600 but can't seem to get $= =600 to work
> correctly.
>
In addition to what C. DeRykus said, I should note that the book Perl Be
Hi Steve,
On Thursday 20 Jan 2011 21:10:39 steve1040 wrote:
> Using the script below I need to add a second line with the following
> text:
> "STAGEHDR|Barcoded"
>
> #!perl
> use strict;
> use warnings;
> my $file = 'path/to/Access.csv';
> my $newline = "ENTHDR|1|3.0";
> {
>local @ARGV = ($fi
Hi Steve,
On Thursday 20 Jan 2011 20:57:50 steve1040 wrote:
> I need to add 2 lines to a file and add the following text.
>
> ENTHDR|1|3.0
> STAGEHDR|Barcoded
>
> I don't have any idea how to do this in Perl
>
In UNIX and UNIX-like systems (including Windows), it is useful to think of a
file
A simple way:
#!/usr/bin/perl -w
open FILE, ">>file.txt";
print FILE "line1\n";
print FILE "line2\n";
print FILE "ENTHDR|1|3.0\n";
print FILE "STAGEHDR|Barcoded\n";
close FILE;
On Thu, Jan 20, 2011 at 3:57 PM, steve1040 wrote:
> I need to add 2 lines to a file and add the following text.
>
> E
I'm trying to dereference the @{$links} produced
by WWW::SimpleRobot and am having a heck of
a time getting it done. Can anybody help?
You can see some of the things I have tried
below.
I know I can do this link extraction myself with
LinkExtor, or at least think I can do it, but
I'd like to kn
On Jan 21, 7:50 am, moonb...@gmail.com (Erez Schatz) wrote:
> On 20 January 2011 15:38, Eyal B. wrote:
>
>
>
> > I'm writing a scripts that check the TTL of the ping and found the OS.
> > According the TTL - the script should let me know which OS it is :
> > Linux/ Windows or Unix (Hash table)
>
>
Using the script below I need to add a second line with the following
text:
"STAGEHDR|Barcoded"
#!perl
use strict;
use warnings;
my $file = 'path/to/Access.csv';
my $newline = "ENTHDR|1|3.0";
{
local @ARGV = ($file);
local $^I = '.bac';
while(<>){
if ($. == 1) {
print "$new
Tried to implement your recommendations step by step .
#! C:\Perl\bin\perl
use strict;
use warnings;
my %list = (60=>"linux",61=>"linux",62=>"linux",63=>"linux",
64=>"linux",65=>"linux",125=>"Windows",126=>"Windows",127=>"Windows",
128=>"Windows",250=>"Unix",251=>"Unix",252=>"Unix",253=>
I need to add 2 lines to a file and add the following text.
ENTHDR|1|3.0
STAGEHDR|Barcoded
I don't have any idea how to do this in Perl
Thanks
Steve
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Hi Eyal,
I should note that your plain text message is mal-formatted. It's not clear
which parts were said by me, and which parts were said by you. Next time,
please configure your mailer (GMail.com?) to format the message as plaintext
and to use proper "> " quoting as needed by netiquette rule
27 matches
Mail list logo