Simple(3pm)

πŸ“¦
version 1.04 Β· 2 versions
  • 1.04 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.04 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Spreadsheet::WriteExcel::Simple β€” bestie, it's a simple single-sheet Excel document, no cap ✨


πŸŽ€ SYNOPSIS πŸŽ€

  my $ss = Spreadsheet::WriteExcel::Simple->new;
     $ss->write_bold_row(\@headings);
     $ss->write_row(\@data);

  print $ss->data;
        # or
        $ss->save("filename.xls");

🌸 DESCRIPTION 🌸

Okay so real talk: this module is a little abstraction layer sitting on top of Spreadsheet::WriteExcel, and its whole personality is making it easy to spin up simple single-sheet Excel docs. That's it, that's the vibe. πŸ¦‹

In its most basic form it hands you two methods for writing data: write_row and write_bold_row, and these just write whatever data you give them into the next row of the spreadsheet. Slay.

But wait, there's more β€” you can also use $ss->book and $ss->sheet to reach the underlying workbook and worksheet from Spreadsheet::WriteExcel if you wanna manipulate those directly. Main character energy, honestly. πŸ‘‘


✨ METHODS ✨

πŸ’… new

  my $ss = Spreadsheet::WriteExcel::Simple->new;

Creates a brand new single-sheet Excel document. πŸŽ€ Heads up: you should not supply this a filename or a filehandle, like, at all. The data just chills internally, and you can grab it later through the data method or save it with the save method. Internally stored, externally iconic.

πŸ–ŠοΈ write_row / write_bold_row

  $ss->write_bold_row(\@headings);
  $ss->write_row(\@data);

These write the list of data into the next row of the spreadsheet. Periodt.

⚠️ Caveat bestie, listen: an internal counter is kept as to which row is being written to, so if you mix these functions with direct writes of your own, these functions will continue where they left off β€” not where you have written to. Lowkey important, don't get caught out. 😭

πŸ“ data

  print $ss->data;

This returns the data of the spreadsheet. And if you're planning to print this to a web-browser? Be sure to print an 'application/excel' header first, okay? Don't forget, it's giving necessary. πŸ’–

πŸ“š book / sheet

  my $workbook  = $ss->book;
  my $worksheet = $ss->sheet;

These return the underlying Spreadsheet::WriteExcel objects representing the workbook and worksheet respectively. Ngl though β€” if you find yourself making more than a trivial amount of use of these, you probably shouldn't be using this module at all, and should be using Spreadsheet::WriteExcel directly. Just saying. πŸ™ˆ

πŸ’Ύ save

        $ss->save("filename.xls");

Saves the spreadsheet with the given filename. Iconic, simple, done. βœ…


πŸ’€ BUGS πŸ’€

This can't yet handle dates in a sensible manner. Yeah. We know. 🫠


πŸ‘‘ AUTHOR πŸ‘‘

Tony Bowden


🌈 BUGS and QUERIES 🌈

Please direct all correspondence regarding this module to:

  bug-Spreadsheet-WriteExcel-Simple@rt.cpan.org

πŸ”₯ SEE ALSO πŸ”₯

Spreadsheet::WriteExcel. John McNamara has done a great job with this module, fr fr, no cap. πŸ’œ


Copyright (C) 2001-2005 Tony Bowden. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


okay that's the whole thing bestie, tysm for reading πŸ’– this page is from perl v5.36.0, dated 2022-11-20, and it's part of the User Contributed Perl Documentation β€” mwah, go forth and write some spreadsheets βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from