Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Perl 6, arrays, hashes, subroutines & basic file IO

by Anonymous Monk
on Oct 15, 2013 at 19:50 UTC ( #1058349=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am wondering if you can help me a bit on output data to a file. Here is my code:
use v6; my $aa = <A L C>; my $peplen = 4; .print for [X]('>', $aa xx $peplen); my $filename = "amino_acid.txt"; my $op = open $filename, :a; $op.print for [X]('>', $aa xx $peplen); $op.close;

I can see the result on my command prompt, but can't see anything on my text file. Any help or suggestions will be greatly appreciated it. Thank you!!

Replies are listed 'Best First'.
Re^2: Perl 6, arrays, hashes, subroutines & basic file IO
by raiph (Chaplain) on Oct 16, 2013 at 15:44 UTC
    I respond more directly to your post below but first:

    This site (PerlMonks) is almost entirely about Perl 5. You're in the right place if your focus is using or developing Perl 5. In contrast, for now, Perl 6 users and developers are generally better off visiting the IRC channel #perl6 on freenode. On #perl6 you'll find p6 experts happy to help beginners most hours of the day. Start by verifying that you have an up to date Perl 6 (#perl6ers will show you how to check) and then explain to #perl6 what you want to do with Perl 6 long term and what you are trying to do with the code you've quoted.

    In case it helps I'll cover a couple things here at PerlMonks. Running your code as it is with a current Rakudo Perl 6 errors out with:

    Error while compiling
    Malformed initializer at ------> $aa = ;

    Fixing that and recompiling gives:

    invoke() not implemented in class 'X'

    So, what is X? To see the gist of something use .gist:

    .print for X.gist

    which returns:


    This is the gist of package X i.e. not what you meant. So, time to visit #perl6. :)


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2018-06-21 10:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.