in reply to How to split long "use Foo::Bar" lines?

It is fairly common to see this presented as:
###<--- max column width --->### use Foo::Bar::Baz::Really::\ Long::Module::Name;
There is also usually a note saying that lines ending in \ should be unsplit. This is consistent with bash notation so some people wll be familiar with it.

--tidiness is the memory loss of environmental mnemonics

Replies are listed 'Best First'.
Re: Re: How to split long "use Foo::Bar" lines?
by Anonymous Monk on May 24, 2004 at 16:41 UTC
    As a a I tried:
    #!/usr/bin/perl -w use Data::\ Dumper; print (@ARGV);
    But when I run that I get this:
    Can't locate Data/.pm in @INC (@INC contains: /usr/lib/perl5/5.8.2/cyg +win-thread-multi-64int /usr/lib/perl5/5.8.2 /usr/lib/perl5/site_perl/ +5.8.2/cygwin-thread-multi-64int /usr/lib/perl5/site_perl/5.8.2 /usr/l +ib/perl5/site_perl .) at ./test.pl line 4. BEGIN failed--compilation aborted at ./test.pl line 4.
      It is not supposed to work in perl -> it is just a markup for the code that the user reads. It is the same as doing something like this:
      # Fill in user details. $user->set('name', 'joe'); $user->set('tel', '01234567'); ... $user->set('email', 'joe@test.com');
      The '...' will not compile - it is just there to represent more stuff. The '\' at the end of a line means 'don't wrap here'.

      --tidiness is the memory loss of environmental mnemonics