perl print command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers perl print command
# 1  
Old 08-02-2005
perl print command

Hi,

I am running this command in perl

print "this is a test message @1.00 pm\n"

but the output i am getting as

this is a test message .00 pm

pls help, how to get the proper output
# 2  
Old 08-02-2005
print "this is a test message \@1.00 pm\n";
# 3  
Old 08-07-2005
or print 'this is a test message @1.00 pm'."\n";

also add "use strict;" to the top of your perl. It will help you find errors like this.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

color print using perl

Hi i want to print the text in different color using perl script. i am able to print on console(terminal). but if i try to print the same into a file, i am not able to do color.pl #!/bin/usr/perl use Term::ANSIColor; print "This text is normal.\n"; use Term::ANSIColor qw(:constants);... (3 Replies)
Discussion started by: roopa
3 Replies

2. Shell Programming and Scripting

Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time.

How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ? Like in Shell script, we use tee, is there anything in Perl or any other option ? (2 Replies)
Discussion started by: butterfly20
2 Replies

3. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

4. Shell Programming and Scripting

using perl to print columnwise

Suppose we have two files one file FAAA_HUMAN.input1 2 5 7 11 and another file FAAA_HUMAN.output M*0.0540*0.0039*0.2212*0.0082*0.0020*0.0137*0.0028*0.0029*0.2198*0.0104*0.0889*0.0282*0.0049*0.0804*0.1743*0.0215*0.0531*0.0071*0.0007*0.0021*0.7270*2.5000*... (4 Replies)
Discussion started by: cdfd123
4 Replies

5. Shell Programming and Scripting

perl with two files and print

Suppose u have two files one file >hi|23433|sp|he is RAJ<space>>hi|23333|df|He is HUMAN<space>>hi|222|gi|howru|just WOWHEISWONDERFUL >hi|25559|gs|heisANUJ<space>>hi|2232|sp|he is fool SKSIKSIKSLKSSLLS Another file HUMAN so output wil be ...if the list contain HUMAN only take it... (1 Reply)
Discussion started by: cdfd123
1 Replies

6. Shell Programming and Scripting

using perl to print 1 or 0

Suppose u have a file FILE A ABCA10 DIFF VALUES P203S POLY ABCA1 DIFF VALUES A1046D ABCA4 DIFF VALUES D846H POLY ABCA4 DIFF VALUES I1846T POLY ABCA4 DIFF VALUES Wa ABCA4 DIFF VALUES WA ABCA4 DIFF VALUES Wb and u want to print that if FILE A have POLY so print 0 otherwise 1 means... (1 Reply)
Discussion started by: cdfd123
1 Replies

7. Shell Programming and Scripting

[Perl] Accessing array elements within a sed command in Perl script

I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows: $count = 0; while ( $count < $#test ) { `sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`; `cat 0 >... (2 Replies)
Discussion started by: userix
2 Replies

8. Shell Programming and Scripting

Perl: Search and print help

Hi all, I need a bit of help with a perl script, I have a file containing lines that look like: M1 (Agnd Agnd ibias_gnP Agnd) nch l=250.0n w=10u m=1 ad=2.5e-12 \ as=2.5e-12 pd=20.5u ps=20.5u nrd=0.025 nrs=0.025 sa=2.5e-07 \ sb=2.5e-07 M21 (Agnd VSSabc Agnd Agnd) nch... (3 Replies)
Discussion started by: Crypto
3 Replies

9. Shell Programming and Scripting

perl - why is the shell script executed before the print command?

i'm writing some simple scripts to help me learn perl. why does the print command get called after the shell script is executed? the purpose of the shell script is to simply echo to the screen "script run". which is does, but before the print command, you can clearly see the shell script is... (3 Replies)
Discussion started by: mjays
3 Replies

10. Shell Programming and Scripting

ls command to print fifo of contents (or perl)

Hello, What are the options to print the contents of a directory in FIFO fashion? I have searched the forum for something relative to this question and found no answers. If there is a way please advise, if it has already been answered, please provide a link to the post. Alternately if... (1 Reply)
Discussion started by: jerardfjay
1 Replies
Login or Register to Ask a Question