Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl script to histogram data 1

Status
Not open for further replies.

programmerc

Programmer
Oct 29, 2010
10
GB
Hi, I wish to apply the following script to histogram a set of data I have

However, when I run the script in the terminal I get the following error.

user$ perl histogram
Bareword "mxs" not allowed while "strict subs" in use at histogram line 30.
Execution of histogram aborted due to compilation errors.


I) Could someone help me trying to understand this (I know nothing about Perl specific coding)
II) How do I define the max,min of my bins?

Thanks
 
The error is just because the posting on perlmonks has several lines wrapped (where the subsequent line begins with a "+"). This should fix it:

Code:
perl -e 'local $/;$_=<>;$_=~s/\n\+//g;print;' histogram > histogram.fixed

Once you've done that, try perldoc histogram.fixed and see if the options answer your second question.

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top