www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/04/21:30:18

Message-ID: <3DC72834.832B8885@junk.net>
From: Ian Chapman <ian_chapman AT junk DOT net>
X-Mailer: Mozilla 4.79 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Perl
Lines: 33
Date: Mon, 04 Nov 2002 21:08:52 -0500
NNTP-Posting-Host: 64.230.55.193
X-Complaints-To: abuse AT sympatico DOT ca
X-Trace: news20.bellglobal.com 1036462086 64.230.55.193 (Mon, 04 Nov 2002 21:08:06 EST)
NNTP-Posting-Date: Mon, 04 Nov 2002 21:08:06 EST
Organization: Bell Sympatico
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm at sympatico dot ca not junk.net by the way.
Hi,
    I'm looking over Perl and I have the following bit of code as I'm
trying to learn perl.  I've noticed that the two prints have a slight
difference.  The second print adds a space in front of the first
character on all lines other  than the first.  Is this normal or is it a
glitch in the dj port ?

        Regards Ian.


===========================================
#!/home/bin/perl -w
#
# Program to open the Text1 file, read it in,
# print it, and close it again.

$file = 'Text1';  # Name the file
open(INFO, $file);  # Open the file
@lines = <INFO>;  # Read it into an array
close(INFO);   # Close the file
print @lines;
$f = "@lines";
print $f;
=========================================
This is the first line
This is the second line
This is the third line
This is the fourth line
This is the fith line
This is the sixth line


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019