Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Is Text::FIGlet broken?

by Anonymous Monk
on Jun 25, 2015 at 17:24 UTC ( [id://1131985]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have tried this on several environments and I keep getting the same mangled results:
my $font = Text::FIGlet->new(-f=>"block", -d=>"/usr/share/figlet"); print $font->figify(-A=>"Hi");
Results:
_| _| _| _| _| _|_|_|_| _| _| _| _| +_| _| _|

Elsewhere:

figlet -f block Hi _| _| _| _| _| _|_|_|_| _| _| _| _| _| _| _|

Any ideas? I am stumped.

Replies are listed 'Best First'.
Re: Is Text::FIGlet broken?
by MidLifeXis (Monsignor) on Jun 25, 2015 at 17:54 UTC

    figify appears to return an array of results in list context (which print provides). Try print scalar $font... or print join($delim, $font...) instead.

    You could see this with...

    ... { my @lines = $font->figify...; my $lines = $font->figify...; use DDP; p @lines; p $lines; } ...

    at the appropriate place in your code.

    --MidLifeXis

      Thank you! My brain was not reaching into that zone. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1131985]
Front-paged by Laurent_R
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-26 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found