Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

form feed

by abhi4.amity
on Feb 03, 2011 at 08:13 UTC ( #885910=perlquestion: print w/replies, xml ) Need Help??
abhi4.amity has asked for the wisdom of the Perl Monks concerning the following question:

what is form feed

Original node content restored below by GrandFather

please tell me about the vertical tab function in perl.what is the application of \v in perl.can u send me one related program to \v.

Replies are listed 'Best First'.
Re: vertcal tab
by ikegami (Pope) on Feb 03, 2011 at 08:37 UTC

    "NOTE: Unlike C and other languages, Perl has no \v escape sequence for the vertical tab (VT - ASCII 11), but you may use \ck or \x0b."

    If it did, \v in string literal would simply include character 0x0B in the resulting string. No more, no less.

Re: vertcal tab
by GrandFather (Sage) on Feb 03, 2011 at 08:39 UTC

    What is your reason for asking? As it stands your question doesn't make a great deal of sense. Perl doesn't recognise v as an escape character. However the ASCII VT (vertical tab, ctrl-k) character can be generated using \x0b.

    True laziness is hard work
Re: vertical tab
by davido (Archbishop) on Feb 03, 2011 at 08:44 UTC

    Here's one program, along with its output:

    use strict; use warnings; print "Hello\v world.\n"

    The output:

    Hellov world.

    I think that sums it up.

    Vertical tab, you say? perlop has a section called "Quote and Quote Like Operators", which you should have a look at to understand what escape sequences Perl recognizes.


      sir ur program is not working please tell me how its is working.the error while running this program is Unrecognized escape \v passed through at line 3. Hello v world.

        That's not an error, it's a warning from use warnings;. So now you've got output showing that \v does nothing more than printing a literal 'v', and a warning telling you that \v is an unrecognized escape sequence, which is being passed through. Add to that the comments by myself and others in the forum (on your other thread with the same subject), as well as the POD that I identified, and you've got more than enough indicators telling you that there is no vertical tab identified by "\v" in Perl's string interpolation.


Re: form feed
by cdarke (Prior) on Feb 03, 2011 at 12:29 UTC
    I noticed that you altered your question. Please, don't do that. If you have a different question then raise a new post.

    Although we welcome questions, this is meant as a Perl forum rather than basic computing questions. Don't push your luck with these questions, I hope you are not going to go through the entire character set.

    A form feed was originally used to throw a new page on a line-printer. On some terminal devices it also cleared the screen. Generally not used much these days.
Re: vertcal tab
by cdarke (Prior) on Feb 03, 2011 at 08:52 UTC
    It might have been in old versions of Perl, but not any more:
    print "<\v>";
    Unrecognized escape \v passed through at C:\ line 6. <v>
    perl 5.12.0

    Update: I rather like this:

    Interestingly it is still mentioned in the 5.12.2 version of perlre.

      perlre seems to be suggesting that regular expressions will recognize \v as vertical whitespace, in text that's being matched. But '\v' as a pattern is not the same as '\v' as a string escape sequence.


Re: form feed
by Old_Gray_Bear (Bishop) on Feb 03, 2011 at 15:09 UTC
    A Form Feed (FF) is a skip-to-channel-twelve command for an IBM line printer. If your printer-control tape does not have a twelve-punch, this is the quickest way to empty a box of continuous form paper....

    I Go Back to Sleep, Now.


Re: vertcal tab
by elef (Friar) on Feb 03, 2011 at 08:49 UTC
    This sounds an awful lot like homework and doesn't make much sense on top of that. "Send me a program related to a vertical tab"...? What for?
Re: form feed
by Anonymous Monk on Feb 03, 2011 at 18:13 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://885910]
Approved by GrandFather
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2018-02-25 02:11 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (312 votes). Check out past polls.