Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old March 7th, 2001, 11:15 AM
eepyoga eepyoga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 11 eepyoga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I know it's a newbie question, but does anybody know why
the line "print OUT $aaa;" does not write onto the file OUT and "print OUT "/***\n";" does???
I'm sure it goes into the if statement 'cause i can see the line "found the function: ..." on the STDOUT.

(I also tried using $_ instead of $aaa)

I just want to put a line read from the file IN and write it onto OUT if the regexp is matched.

################# CODE #############
open (IN, "< $ARGV[$i]");
open (OUT, "> $ARGV[$i].pod");

print OUT "/***\n"; ### WORKS ###
while ($aaa=<IN>) {
print OUT "=head1 NAME\n\n";
if ($aaa =~ /^\s*function\s*\S+/) {
$aaa =~ s/^[\s]*//;
print "found the function: $aaa\n";
print OUT $aaa; ### DOES NOT WORK ###
}
close (OUT);
}
close (IN);
}
########### END OF CODE #############

Any help will be really really really appreciated.

thx in advance...

---------
eepyoga.


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > writing to file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway