Hello again anirbanphys,
If you want to write the output to the file in one line you can do it like this:
io('out.txt')->appendln($_) for @lines;
__END__
$ perl test.pl
$ cat out.txt
library(and_gate) {
delay_model : table_lookup ;
date : "Fri Mar 15 03:44:39 " ;
time_unit : 1ms ;
voltage_unit : 1V ;
current_unit : 1A ;
operating_conditions ("AB0.5v45c") {
process : 1 ;
temperature : 45 ;
voltage : 0.5 ;
}
default_operating_conditions : "AB0.5v45c"
input_voltage(default) {
vi : 0 ;
vh : 0.5 ;
vim : 0 ;
vin : 0.5 ;
}
}
You can use the method IO::All/appendln from the same package as you do for reading.
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|