in reply to formline and right-justification [SOLVED]

Ok, quick and dirty script, does this do what you want it to do ?
#!/usr/bin/perl use strict; use warnings; my ($string) = 'abcdefghijklmnopqrstuvwxyz'; my ($fragment) = substr($string, length($string) - 7); print "...$fragment\n";

Replies are listed 'Best First'.
Re^2: formline and right-justification
by davidrw (Prior) on Jun 18, 2006 at 15:16 UTC
    No need for the length call -- you can just do: substr($string, -7)
Re^2: formline and right-justification
by nostromo (Sexton) on Jun 18, 2006 at 15:12 UTC
    hehe, good approach, freakingwildchild.
    of course this would do what i need, but it assumes one has the width of the output terminal, which i do not have.
    since there are various ways to get this info, i'll use your snippet, if no solution is given including a formline-format string.
    thank you :)
      my mistake. of course i know the width. sorry, you were right here :)